So first of all Trees are a data structure that is used to store data in a hierarchical format, so trees are not a linear data structure. We can define a tree also as a collection of nodes where each node will contain a data value and a link to others child node.
In trees we do not store data in sequence, trees will store the data in multiples levels and multiples nodes.
Important terminologies
Root
In the trees the first node will always be the Root Node. Every tree will have one and only one root node, we also can say that the root is the origin in this kind of data structure.Edge
All links between the nodes of the tree will be called as Edge, and in a tree with 'N' number of nodes will always have a maximum of 'N-1' number of edges.Parent
The predecessor of any node is always called as Parent Node.Child
The descendant of any node is called as Child NodeSiblings
All nodes that have the same Parent are called as Siblings, in other word all nodes with same parent are called Sibling nodes.Leaf
All nodes that doesn't have a child node are called as Leaf Node.
Top comments (0)