Hacker News new | ask | show | jobs
by stabbles 99 days ago
I'm sure you've stumbled upon graphs that are not trees, which can be represented with tables.
3 comments

But on the other hand table are represented with trees![1]

[1]: https://en.wikipedia.org/wiki/B-tree#B-tree_usage_in_databas...

And those trees are usually represented as tables via an array of structs or similar. IMHO, the architecture of memory and memory access should push us more towards tables as a default data structure than trees.
As long as there are no self loops, then you can represent a graph with a set of spanning trees that cover the edges. This is particularly efficient when using a depth or parent vector tree representation and is seen in HPC applications.
Everything can be a tree with a single node that stores a blob of the data in whatever format you want.