Tuesday, 15 November 2016

3rd Sem Data Structure Assignment - 3

B.E 3rd SEM CSE Department

DATA STRUCTURE (2130702)

Assignment:-3

Tree:



1.      Define the following terms:
Tree, Leaf node, Parent node, Childe node, Root node, Height,
Binary tree, Complete Path, Sibling, Forest.
2.      Define Tree. Write an algorithm to do in order traversal & post order traversal of Binary
Search Tree.
3.      Create a Binary Search Tree for the following data and do In order, Preorder and Post order traversal of the tree.
                 42, 65,25, 55, 10,70,30,50,15,80,75
4.      Write a short note on threaded binary tree.
5.      Obtain the expression tree from the following post fix representation ab+cde+**
6.      What is use of binary search tree? Construct sequential order binary tree (binary search tree) for following values and Do inorder , preorder and postorder
1) 10,15,17,8,7,9,11,12,13,4,14,5
2) 8,3,11,5,9,12,13,4,6,20
3) 50, 60, 25, 40, 30, 70, 35, 10, 55, 65, 5
4) 50 ,25 ,75, 22,40,60,80,90,15,30
5) 10,3,15,22,6,45,65,23,78,34,5
6) 45,56,39,12,34,78,54,67,10,32,89,81
7) 50, 60, 25, 40, 30, 70, 35, 10, 55, 65, 5
8) 40, 65,25, 55, 10,70,30,50,15,80,75
9) 10,3,15,22,6,45,65,23,78,34,5
7.      Construct AVL tree for following data
1)10,20,30,40,50,60,70,80
2) 150, 155, 160, 115, 110, 140, 120, 145, 130, 147, 170, 180
3) 42,06,54,62,88,50,22,32,12,33
4) 65, 10, 44, 26, 13, 110, 98, 85
8.      What are the advantages of Multi way search tree over binary search tree? Construct  2-3 tree for the following data
      12, 50, 85, 6, 10, 37, 100, 120, 25, 70
9.      Write a non-recursive algorithm for Preorder traversal of a binary tree.
     10. Given the following traversals create a binary tree from that. Also give the Postorder                         traversal for the same.
    Preorder = (7,10,4,3,1,2,8,11)
    Inorder = (4,10,3,1,7,11,8,2)
     11. Generate a binary search tree for following numbers and perform in-order and post-order                traversals: 
                   50, 40, 80, 20, 0, 30, 10, 90, 60, 70
     12. Write an algorithm to delete a node from tree.



No comments:

Post a Comment