Below is a rooted tree, where any node
C except root has one parent
Ancestors of a node
C are the nodes on path from
P's grandparent, .... till
My understanding is, Tree is just a set of nodes & edges that connect these nodes. Between any two nodes there is exactly one single path. A tree does not need to have any
Any rooted tree MUST be a tree but any tree may not be a rooted tree.
In the below tree(not a rooted tree),
My understanding is, parent-child, depth, height, subtree, siblings, leaf-node concepts are only applied to rooted trees.
If no, then,
X a parent of
Y? If yes, Who are the ancestors of