Description
1. Write a C program to perform the following operations in a BST:
– Insert a key value in a tree (iterative logic)
– Insert a key value in a tree (recursive logic)
– Delete a key value from the tree
– Search a key value and return its node address (if found)
– Traverse the tree
– Display the depth of the tree
2. Given the inorder and postorder traversal sequence, write a C program to construct the binary tree.
3. Given values ‘x’ & ‘y’ write a C code to find the Lowest Common Ancestor (LCA) node of two key values ‘x’ & ‘y’ in a BST.
[Hint: you may try to write a recursive algorithm; the trick is to find such a node which has one of the keys in the left subtree and the other in the right subtree while descending down from the root node]
4. Given a binary tree display it’s key sequence following breadth first search (bfs).
[Hint: use queue data structure]