Tree Concept



 














DEGREE of TREE = 3

DEGREE of C = 2

HEIGHT = 3

PARENT of C = A

CHILDREN of  A = B, C, D

SIBILING of F = G

ANCESTOR of F = A, C

DESCENDANT of C = F, G
Node at the top is called as root.

A line connecting the parent to the child is edge.

Nodes that do not have children are called leaf.

Nodes that have the same parent are called sibling.

Degree of node is the total sub tree of the node.

Height/Depth is the maximum degree of nodes in a tree.

If there is a line that connects p to q, then p is called the ancestor of q, and q is a descendant of p. 
Binary Tree Concept

A sample of binary tree
of 9 nodes, rooted on
node which contains 18.
Leaves are nodes which
contain 9, 12, 10 and 23.
 


Komentar

Postingan populer dari blog ini

Pointer, Array and Introduction to Data Structure-fernando-2101637812

Binary Tree