Don't miss

## Tree(Computer Science) in data structure

on 23:51

Tree is an non-linear data structure which represent the hierarchical relationship between data items(nodes).Tree specified One:Many(1:M) relationship 1:M means one parent and more than one children but the child have the single parent.Tree deals in C++,java etc.

In the above example we tried to explain that what is root of tree,branch of tree,ancestor of tree,
descendant of tree,siblings of tree,degree of node,height of tree,depth of tree,generation of tree.
So starting with root of tree.

Root of tree:-Like the biological tree,computer tree has also contains root.

The node which are in the
beginning of tree called as root node.

Branch of Tree:-The line which connect nodes are called as branches of tree.

Leaf Node:-Leaf node are those node which have no children.This node also called as terminal node.

Non-Terminal Nodes:-Those node which possess children are called as terminal node.

Descendant of Tree:-Descendant is the path from node to leaf  node.For example the descendant of A to M are B and J.

Ancestor:-Ancestor is the path from node to root.For example ancestor of M are J,B,A.

Siblings of Tree:-The children node of the same parent are called as Siblings.

Generation of Tree:-Those node which are at same level are called as generation.

Degree of Node:-The sub-tree(s) of the node are called as Degree of node.For example degree of J is 3.

Note:-The node of degree 0 are called as leaf node.

Height/Depth of Tree:-The length of longest path from root to node is called as height of node.