Skip to content

Comment on What are the lesser known but cool data structures?parent

Comments

Isn't that how clojure works?

IIRC, clojure works with 64-ary trees, which are a different data structure, but both share the property that 'leaves' contain more than one object. An unrolled linked list node would have, say, 63 objects and a pointer to another node. A 64-ary tree node will either have 64 objects, or pointers to 64 other nodes. One important property is that because each middle node in the tree has 64 children instead of 2, the depth of the trees are very very shallow in practice.

However, it's possible that clojure uses this layout for arrays and a different ones for lists or other sequences.

I found a link to the implementation details, you are correct:

http://blog.higher-order.net/2009/02/01/understanding-clojur...

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.