5 ms·
Well mathematically we represent trees with matrices. So anything that can edit tabular data can edit trees.
by sjtrny 13y ago
Well mathematically we represent trees with matrices. So anything that can edit tabular data can edit trees.
- maaku 13y agoDo we? That's only one possible implementation, and not a very efficient one for most uses.
- sjtrny 13y agoEfficient in what sense? Computationally and storage wise it is the most efficient.
- cjfont 13y agoBut not very human-readable and therefore it is inadequate for editing.
- sigstoat 13y agothat isn't true. there are tradeoffs between using an adjacency matrix, and other representations. different operations will be more efficient on different representations. and in the special case of extremely sparse graphs like trees, the adjacency matrix isn't going to win very often. your copy of CLRS should discuss all of this. and for practical uses of non-adjacency matrix representations of trees, you can take a look at every functional programming language, ever.
- pcmonk 13y agoYou can represent trees with matrices. You can also represent trees with bits. What we want is a representation that is both easy to read and easy to write.