Tree Terminologies
Root: Node with no parent / topmost node
Edge: Link from parent to the child node
Leaf: Node with no children
Sibling: Children of the same parent
Ancestor: Parent, grandparents, great grandparents and so on of a node
Depth of node: Length of the path from the root to the node.
Height of node: Length of the path from the node to the deepest node
Height of tree: Same as the height of the root node
Depth of tree: Same as the depth of the root node, which is always 0
Predecessor: Immediate previous node in Inorder traversal of the tree
Successor: Immediate next node in Inorder traversal of the tree
Comments
Post a Comment