ASSIGNMENT 11: Trees
-
WAP to insert and delete a node from the BST. Solution
-
WAP for Tree Traversal in Pre-order. Solution
-
WAP for Tree Traversal in In-order. Solution
-
WAP for Tree Traversal in Post-order. Solution
-
WAP to search the element in a Binary search tree. Solution
-
Read n ints and make a binary search tree (BST). Do k search operations to print results as y/n. Solution Input: (n, x_i, k, y_i) 4 2 1 4 3 3 3 7 1 Output: y n y
-
Read n ints and make a BST in the same order. Print the tree in preorder, inorder and postorder traversals. Separate characters by ‘_’. Implement using C programming. Solution Input: (n, x_i) 4 2 1 4 3 Output: 2_1_4_3_ 1_2_3_4_ 1_3_4_2_
-
Read 2n ints. Use each half to create two BSTs in the given order. Find if the two trees are identical. Print y/n. There are T test cases. Implement using C programming. Solution Input: (T, n, x_i) 3 3 1 2 3 1 3 2 1 2 3 2 3 1 2 1 3 2 3 1 Output: n n y