Message 1 of 8
Converting a List into a Binary tree
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am reading a book about common lisp and its talking about binary tree data structures. They give a list of (A B (C D) E) and they also give a graphical representation of it. I believe each box is either the CAR or the CDR of the cons cell. The terminal nodes of the tree are the atoms A, B, C, D, E, and NIL. The nonterminal nodes are the cons cells.
They say "To view this diagram as a binary tree instead of a list, turn the page 45 degrees clockwise". I am having a little trouble visualizing what that would look like and I could use some help as to what the binary tree would look like. Its a very good book in my opinion. but just saying to turn it 45 degrees clockwise is not helping me visualize this.