What is TREE A tree is a non-linear data structure in which item are arranged in a sorted sequence. It is used to represent hierarchical relationship existing amongst several data items.
TERMINOLOGY OF TREE It is specially designed data item in a tree. It is the first in the hierarchical arrangement of data item. C CHILD F ROOT (PARENT) A B D E F G H LEAF ROOT
NODE Each data item in a tree is called a node. It is the basic structure in a tree. It specifies the data information and links(branches) to other data items. F A B D C E F G H
EDGE It is a connecting line of two nodes. That is, the line drawn from one node to another node is called an edge. F A B D C E F G H EDGE
LEVEL The entire tree structure is levelled in such a way that the root node is always at level 0. Then, its immediate children are at level 1 and their immediate children are at level 2 and so on upto the terminal nodes. F A B D C E F G H LEVEL 1 LEVEL 2 LEVEL 3
SIBLINGS The children nodes of a given parent node are called siblings. They are also called brothers.
TERMINAL NODE A node with degree zero is called a terminal node or a leaf. TERMINAL NODE Any node(except root node) whose degree is not zero called non-terminal node . DEGREE OF A NODE It is the number of subtrees of a node in a given tree. DEGREE OF A TREE It is the number of maximum degree of nodes in a given tree.
PATH It is a sequence of consecutive edges from the source node to the destination node. F A B D C E F G H I SOURCE NODE DESTINATION NODE
BINARY TREE A binary tree is a finite set of data items which is either empty or consists of a single item called the root and two disjoint binary trees called the left subtree and right subtree. In a binary the maximum degree of any node is at most two. F A B D E F G H C I H I H
Tree in data structure

Tree in data structure

  • 2.
    What is TREE A tree is a non-linear data structure in which item are arranged in a sorted sequence. It is used to represent hierarchical relationship existing amongst several data items.
  • 3.
    TERMINOLOGY OF TREE It is specially designed data item in a tree. It is the first in the hierarchical arrangement of data item. C CHILD F ROOT (PARENT) A B D E F G H LEAF ROOT
  • 4.
    NODE Each dataitem in a tree is called a node. It is the basic structure in a tree. It specifies the data information and links(branches) to other data items. F A B D C E F G H
  • 5.
    EDGE It isa connecting line of two nodes. That is, the line drawn from one node to another node is called an edge. F A B D C E F G H EDGE
  • 6.
    LEVEL The entiretree structure is levelled in such a way that the root node is always at level 0. Then, its immediate children are at level 1 and their immediate children are at level 2 and so on upto the terminal nodes. F A B D C E F G H LEVEL 1 LEVEL 2 LEVEL 3
  • 7.
    SIBLINGS The childrennodes of a given parent node are called siblings. They are also called brothers.
  • 8.
    TERMINAL NODE Anode with degree zero is called a terminal node or a leaf. TERMINAL NODE Any node(except root node) whose degree is not zero called non-terminal node . DEGREE OF A NODE It is the number of subtrees of a node in a given tree. DEGREE OF A TREE It is the number of maximum degree of nodes in a given tree.
  • 9.
    PATH It isa sequence of consecutive edges from the source node to the destination node. F A B D C E F G H I SOURCE NODE DESTINATION NODE
  • 10.
    BINARY TREE Abinary tree is a finite set of data items which is either empty or consists of a single item called the root and two disjoint binary trees called the left subtree and right subtree. In a binary the maximum degree of any node is at most two. F A B D E F G H C I H I H