- Back to Home »
- CS301 Assignment no 4 Fall 2012 Full solution
Posted by : Anonymous
Tuesday, 27 November 2012
Assignment Statement: Marks: 20 | |
A “Binary Search Tree” (BST) is a type of binary tree with the following property: “Items in the left subtree are smaller than the root, and items in the right subtree are greater than the root”. Consider the following Binary Search Tree (BST): Keeping in mind the property of Binary Search Tree (BST), Write a program in C++ which stores the above tree (BST) incomputer memory and performs the following operations on the tree:
Solution Guidelines: Your Program should contain a BST class which should include the following functions:
In main ( ) function, create an object of type “BST” and call above functions one by one against each operation. Sample Output: Note: In sample output, values of nodes are displayed using preorder traversal. |