3 ms·
Trees as Linked Lists in Common Lisp (2010)
- analognoise 12y agoIs it me or does the second figure look incorrect? I don't see a key to differentiate between solid lines and dashes either, but I'm mobile now so I can't easily check.
- mbrubeck 12y agoThe figure is correct. In the first part of the article, a tree is represented as (cons root children). So the example tree (1 (2 6 7 8) 3 (4 (9 12)) (5 10 11)) has "1" at its root, and four children. Its first child (2 6 7 8) is a tree with "2" at its root, and three children which are all leaves. And so on. The solid lines are parent relationships, and the dotted lines are sibling relationships. For each list, the first two items are connected by a solid line, and the remaining items by dotted lines.
- analognoise 12y agoAh, I see how they are equivalent now, thank you greatly.
- enord 12y agoThis is Very Basic Stuff(tm). I wonder if the same topic would receive similar attention in, say, Java.
- deleted 12y ago[deleted]