In a tree, any node is predecessor and successor of itself.
--> so, the intersection of predecessor set and successor set is the node itself.
Also height and depth of a node in a tree are different things.
Height is calculated from leaf
It is distance of node from farthermost leaf node who is its successor.
Depth is calculated from root.
It is length of a path from root to the node.
--> so, the intersection of predecessor set and successor set is the node itself.
Also height and depth of a node in a tree are different things.
Height is calculated from leaf
It is distance of node from farthermost leaf node who is its successor.
Depth is calculated from root.
It is length of a path from root to the node.
No comments:
Post a Comment