$35
Programming
Binary Search Tree
.
Modify the BST program that is discussed in the class by adding the following functions :
1 Write a function that builds a binary search tree by inserting the following nodes into the tree. ( 70 50 100 30 60 80 110 20 68 90 120 25 62 ). The function must display the binary search tree.
2. Write a function that traverse and displays the tree in pre-order form.
3. Write a function that traverse and displays the tree in post -order form.
4. Write a function that displays all the right sub roots of that tree.
5. Write a function that displays all the left sub roots of that tree.
6. Write a function that counts and displays the number of leafs in the tree.
7. Write a function that displays only the leafs of the tree. Note:
· You have to use only dynamic arrays when implementing this program ( items 1- 7 where applicable ). Cannot use fixed size array , or
linked lists.
· Cannot use library functions such as swap, sort , vector ... etc. for this programming assignment.
· In the sample output , Replace My name (Husain Gholoom) with your first and last name.