Lab Assignment 8 (BST)
Lab Assignment 8 (BST)
3. Write a program for binary search tree (BST) having functions for the following
operations:
Practice questions
6. Given preorder and in-order traversals, write a program to construct the Binary Tree.
7. Given in-order and post-order traversals, write a program to construct the Binary Tree.
8. Write a program to merge two BSTs into a doubly-linked list in sorted order.
Example Input:
20
T1 / \
10 30
/ \
25 100
50
T2 / \
5 70
Output:
5 <—> 10 <—> 20 <—> 25 <—> 30 <—> 50 <—> 70 <—> 100 <—> null