Chapter 5: Tree Data Structure
What is Tree? Explain.
Tree is a non-linear data structure. Tree represents the nodes connected by edges.
Terminologies Used in Tree Data Structure
Root
The node at the top of the tree is called root. There is always only one root per tree.
Path
Sequence of nodes along the edges of a tree is called path.
Parent
The node above the given node and connected by its edge upward is called parent node.
Child
The node below the given node and connected by its edge downward is called child node.
Leaf
The node which does not have any child node is called Leaf
Key
Key represents value of a node. Key is used in search operations to find out a particular node.
Siblings
A group of nodes with the same parent.
Descendant
A node reachable by repeated proceeding from parent to child.
Ancestor
A node reachable by repeated proceeding from child to parent.
Edge
The connection between one node and another.
Depth
The depth of a node is the number of edges from the tree's root node to the node.