BST Assigment Help!

erm87

New member
Joined
Mar 14, 2018
Messages
2
Programming Experience
Beginner
Hello,

I need help in my assignment for BST, we need to build a console application that does the ff:

Using the LINKED LIST IMPLEMENTATION*:1. Display the following menu:[1] Insert node to binary tree[2] Delete node from binary tree[3] Minimum[4] Maximum[5] Successor[6] Predecessor[7] Search[8] Print BST2. Start off with an empty tree.3. When the user chooses [1], the program prompts the user to enter a value.After searching for its proper position, the node is then inserted into theBST.4. When the user chooses [2], the program asks the user what value to delete.The value is deleted if it is found in the BST. An error is shown if no valueexists.5. Choosing [3] displays the minimum value in the BST.6. Choosing [4] displays the maximum.7. Choosing [5] would display the successor of a node of which the value hasbeen specified by the user.8. Choosing [6] displays the predecessor of the node whose value has beenspecified by the user.9. Choosing [7] searches for the value specified by the user. Display a messageif the value is not in the BST.10.Choosing [8] prints out the contents of the BST in increasing order.

Anyone can help? I am stuck with min, max and the rest. TIA!
 
Assuming you have a list of values and you want to find the greatest of them, you would start with a variable initialised to the smallest possible value. You would then loop through the list and compare the current item to that variable. If the current item is greater than the variable then you assign the current item to the variable. At the end of the loop, the variable contains the greatest value from the list. Finding the minimum value is basically the same.
 

Latest posts

Back
Top Bottom