Y
Hacker News
new
|
ask
|
show
|
jobs
by
dastbe
3552 days ago
Do you give them a graph data structure or something that is explicitly a tree?
1 comments
dnautics
3552 days ago
A acyclic graph is isomorphic to a tree, but the way you access the vertices and edges is completely different.
link
palunon
3551 days ago
Depends on your memory representation of the graph. If you simply use the obvious one (a node have a list of pointers to its successors), I don't see the difference except for successors[]/children[]
link
dnautics
3551 days ago
You're right. I mentioned acyclic graph and my mind slipped to general graphs. Although often graphs are represented as say a sparse matrix.
link