3 ms·
A linked list is just a simpler version of both a graph and a tree. What data structure would you suggest to represent both/either of those? Or are you asserti
by grayhatter 2y ago
A linked list is just a simpler version of both a graph and a tree. What data structure would you suggest to represent both/either of those?
Or are you asserting, because you've never used them they're not common? Because while maybe I agree, and I don't often reach for a linked list, I've built plenty of trees and graphs.
- kllrnohj 2y agoTrees and graphs serve useful roles, of course, but calling a linked list just a simpler version is a stretch. It'd be like calling an array a simplified B-tree. The simplification changes not just the implementation but also radically changes the applicability of the result.
- grayhatter 2y agoexcept a tree or graph with multiple pointers is similar to linked list with one pointer. where as a b-tree stored in an array without pointers probably shouldn't be called a b-tree. or am I missing something?