Sei sulla pagina 1di 2

DATA STRUCTURES AND ALGORITHMS

QUESTION BANK FOR INTERNAL TEST II

Unit - 2
Part - A 1. Define non-linear data structure 2. Define tree. 3. Define Leaf. 4. What is meant by directed tree? 5. What is a ordered tree? 6. What are the applications of binary tree? 7. What is meant by traversing? 8. What are the different types of tree traversing? 9. Define pre-order traversal. 10. Define post-order traversal 11. Define In-order traversal. 12. Define expression trees. 13. Compare general tree and binary tree. 14. Define the following terminologies in a tree. 1) Siblings, Parent 2) Height, Path 15. Give the array and linked list representation of tree with an example. 16. Write a routine to find the minimum element in a given tree. 17. What is a full and complete binary tree? 18. List the cases to be considered in deleting a node from a binary search tree. 19. What are the limitations of binary tree? 20. How do you convert general trees into binary trees?

Part - B 1. Discuss how a node could be inserted in a binary tree? (8) 2. Write a procedure in c to find the Kth element in binary tree. (8) 3. Derive the expression tree for the expression (a+b+c)+((d*e+f)*g). Briefly explain the construction precedure for the above. (8) 4. Write routines to implement the basic binary search tree operations. (10) 5. Show that the maximum number of nodes in a binary tree of height H is 2(pow)H+1-1. (5) 6. Construct an expression tree for the expression (a+b*c)+(d*e/f)-g. (6) 7. Show the result of inserting the nodes 2,1,4,5,9,3,6,7 into an initially empty Binary Search tree. (12) 8. Write routine to perform FindMin and FindMax element in binary search tree with suitable examples. (10) 9. What are the steps followed for constructing an expression trees? (6) 10. What are the two methods of binary tree implementation? (10)

Unit - 3 Part - A 1. What is a balance factor in AVL trees? 2. What is the length of the path in a tree? 3. Define single rotation on AVL tree. 4. List any two applications for B Trees. 5. Define B Tree. 6. What is the minimum number of node in an AVL Tree? 7. Explain the representation of priority queue? 8. What is meant by binary heaps. 9. Is the following tree an AVL tree? Justify your answer.

10. What are AVL trees? What are its advantages. 11. What are the various ways of balancing an unbalanced tree? 12. What are the two properties of a binary heap?

Part - B 1. Start with an empty AVL search tree and insert the following keys in the given order: 15, 14,13,12,11,10,9,8,7,6,5,4,3,2,1. Draw figures depicting your tree immediately after each insertion and following the rebalancing rotation (if any). Label all nodes with their balance factors and identify the rotation type if any) that is done. (16)

2. Explain with algorithm how insertion and deletion is performed in a AVL tree. Explain how the tree is balanced after the operation (16). 3. Explain with examples how a node is inserted into an AVL tree. Discuss all possible cases. (16) 4. Explain the binary heap in detail. (8) 5. Write suitable ADT to perform the following operations in an AVL tree. (12) a. Insert a node b. Delete a node 6. Write a function to perform insertion and deletemin in a binary heap. (10) 7. Explain the following operations in a binary heap with suitable example. (10) a. Insertion b. Deletemin 8. Write a routine to perform insertion into a B-Tree. (8) 9. Briefly explain B-Tree with an example and perform insertion and deletion inside an initially empty B-Tree.

Potrebbero piacerti anche