What is tree?

Tree

It is a non linear data structure which ids used  to represent data in hierarchy format.
Its main objective to implement hierarchy database in DBMS.In other word tree can be define as-
                         It is a collection of vertices and edges. It is similar to graph but tree does not contain any cycle so we can say that all tree are graph but all graph are not tree.


A tree is said to be a non cyclic graph because it does not contain any cycle.


Tree Terminolgy

Node:- An element of tree is called node.It is also called vertex.

Parent node:- Those node that have child node called  child node.

Child node:- Those node that have parent  node called child node.

Leaf node:- Those node that have no any child node called leaf node.It is also  know as terminal node.



Left subtree:- The entired node at left side area called left subtree.

Right subtree:- The entired node at right side area called right subtree.

Successor node:- Those node that can not have any child node called successor node.

Predecessor node:- Those that can have any child called predecessor node.

Inter node:- Those node that can have at least one child is called inter node.In other words excluding leaf node  all nodes are called inter node.


Sibling:- Those node that can have same parent called sibling.

Ancestor:- Excluding leaf node all nodes are called ancestor


Comments

Popular posts from this blog

python pattern programming

Decision making statement in python

Looping statement in python