Module 4
Module 4
4. Explain the algorithms for performing pre-order, in-order and post-order traversal on a binary tree.
5. Given a in-order traversal and a pre-order traversal, construct the binary tree.
In-order traversal: D B E A F C G and Pre-order traversal: A B D E C F G
6. Explain binary search trees using example. How are these different from binary trees?
7. Describe how following operations are performed on a binary search tree.
a. Searching for a Node in a Binary Search Tree
b. Inserting a New Node in a Binary Search Tree
c. Deleting a Node from a Binary Search Tree
d. Determining the Height of a Binary Search Tree
e. Determining the Number of Nodes
f. Finding the Mirror Image of a Binary Search Tree
g. Deleting a Binary Search Tree
h. Finding the Smallest Node in a Binary Search Tree
i. Finding the Largest Node in a Binary Search Tree
8. Create a binary search tree using the following data elements: 45, 39, 56, 12, 34, 78, 32, 10, 89,
54, 67, 81
9. Explain how an element is removed from a BST using simple examples.
10. Consider a binary tree and write an equivalent one-threaded tree of the same.
11. Define AVL trees. How are they different from BST?
12. Using simple examples, demonstrate how rotations are performed in AVL trees during insert and
delete operations.
13. Construct an AVL tree by inserting the following elements in the given order. 63, 9, 19, 27, 18,
108, 99, 81.
14. Describe min heap and max heap along with examples.
15. Construct a max heap H from the given set of numbers: 45, 36, 54, 27, 63, 72, 61, and 18.
16. Explain the different operations performed on a binary heap.