lab2 - Find minimum : Find the minimum element in BST. in :...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS6140 Advanced Programming Lab Exercise 2 Due 24th August 2010 2:00 PM 1 Problem Write C++ programs to implement the following Binary Search Tree (BST) operations. The nodes in this BST must have integers as data. The description and expected input and output is also described below. 1. Insert element : Insert an element into BST. in : element to insert out : success or failure 2. Delete element : Delete an element from BST. If element not found, inform user. in : element to delete out : success or failure 3. Search element : Search an element to see if it exists in BST. in : element to search out : success or failure 4. Find predecessor : Find predecessor of an element in inorder. in : element to search predecessor of out : predecessor element or error (if element not found) 5. Find successor : Find successor of an element in inorder. in : element to search successor of out : successor element or error (if element not found) 6. Display inorder : Display the inorder traversal string of the BST in : none out : inorder traversal string 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
7.
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Find minimum : Find the minimum element in BST. in : none out : minimum element 8. Find maximum : Find the maximum element in BST. in : none out : maximum element NOTE: (1) Create new/use old data structure libraries you have created and need according to your discretion. (2) Failure of an operation can be internally represented as special return values in functions (say, some invalid value. -1 if input is only positive integers.) 2 Input-output formats This program should not take file(s) as input nor print output into file(s). Instead, input should be menu driven. The above mentioned operations should be shown as menu options (with an additional item for “Exit program”) which the user repetitively is shown after each option is executed until “Exit program” is chosen. For instance,-----------------------------Welcome to my application! Menu 1. Create 2. Destroy 3. Move 4. Exit application Enter selection> 1-----------------------------2...
View Full Document

This note was uploaded on 09/08/2010 for the course COMPUTERSC cs5800 taught by Professor Narayanaswamy during the Spring '10 term at Indian Institute of Technology, Chennai.

Page1 / 2

lab2 - Find minimum : Find the minimum element in BST. in :...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online