4 ms·
Do we? That's only one possible implementation, and not a very efficient one for most uses.
by maaku 13y ago
Do 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.