Saturday, June 16, 2012

what TREE refers to in DataBase


Tree is a non-linear data structure which consists of non-empty set of vertices(or nodes) and a set of edges where each nodes are connected to each other with no multiple edges or loops(i.e. no simple circuits)


Terminologies on tree:


 
i)Degree of node is number of edges incident to that node
      e.g. degree of node a is 3

ii)Path is sequence of edges from source to the destination node 
    e.g. path from node a to node d is (ab,bc,cd)

iii)Root is node from tree grow
    e.g node a  is root node

iv) leaf / terminal / vertex are  end  node  of the tree
    e.g. nodes d,e,m,j,k,i,h are leaf nodes

v)parent node are  all nodes except leaf nodes from which  other nodes emerges
    e.g. b is parent node for c,d, e nodes

vi)child node are all nodes except root node which grow from their parent node
   e.g. l,k, m, g  are child nodes for f

vii)siblings are nodes having same parent
   e.g. l,k,g are siblings node as their parent is f

viii)ancestors are all nodes above a node up to root
    e.g.a,b, c are ancestors nodes of d node

ix)descendants are all  nodes below the node up to leaves
   e.g. l,m,g,h,i,k are descendents of f node


Level of vertex is the length of unique path from thee root to that vertex.The level of root is zero.
Height of a rooted tree is the minimum of the levels of vertices i.e. length of longest path from root to any vertex

No comments:

Post a Comment