Re:Data-oriented design or why you might shoot yourself in t...
by jstanley on Monday June 28, 2021 @11:48AM
(#27663414)
This is clearly a tree, but doesn't B have 2 paths through it? A->B->D and A->B->E.
[ Parent
| on HN ]
Re:Data-oriented design or why you might shoot yourself in t...
by gmfawcett on Monday June 28, 2021 @11:58AM
(#27663549)
You're right. The correct definition is that any two vertices are connected by (i.e. are the endpoints of) exactly one path.
Fun fact -- since graph-theory trees are undirected by definition, an inheritance graph is more properly called an arborescence (for single inheritance). For multiple inheritance it's a DAG (with diamond-pattern) or a directed tree (without).
Re:Data-oriented design or why you might shoot yourself in t...
by jholman on Tuesday June 29, 2021 @08:49PM
(#27683672)
> any two vertices are connected by (i.e. are the endpoints of) exactly one path
No.
You just described a connected acyclic graph, not a tree.
In addition to being connected and acyclic, a tree must also have a root, and is thus implicitly directed.