Representing Hierarchies(gpfault.net)
gpfault.net
Representing Hierarchies
https://gpfault.net/posts/first-child-next-sibling.html
3 comments
[deleted]
whether you allocate a big array and store indices into it or whether you keep pointers to dynamically allocated memory is orthogonal to how you actually represent the hierarchy.
Myself, I like to just allocate a too big block and shove everything into that then deal with indicies into that array if I care about performance. you can even flatten the tree in a way to get better locality if you care about that.