subject

Build a Java program that will support the creation of a Binary Search Tree, hereinafter referred to a BST. This program will support reading a command file that supports insertion, deletion, searching, printing, and subtree children and depth counts. All output will be to either STDOUT or STDERR 2 Requirements
1. Read the input file formatted as follows. The input file will contain at least one command per line, either insert, delete, search, print, or quit. These are defined in detail below. For example, one of the input files, named in5.txt contains the following
i 9
i 24
i 3
i 4
i 11
p
q
2. The specific commands are i for insert, d for delete, s for search, p for print, and q for quit.
(a) Insert
The insert command uses the single character i as the command token. The command token will be followed by a single space then an integer. (This command's success can be verified by using the print command.)
(b) Delete
The delete command uses the single character d as the command token. The command token will be followed by a single space, then an integer. In the event that the integer cannot be found, the program will issue an error message and recover gracefully to continue to accept commands 100: NOT found (This command's success can be verified by using the print command.)
(c) Search
The search command uses the single character s as the command token. The command token will be followed by a single space, then an integer. In the event that the integer cannot be located, the program will advise the user with a message. See the Output section for an example.
(d) Print
The print command uses the single character p as the command token. This command will invoke the print function which will output the data in the tree inorder This command is critical for verification of all the commands specified above
(e) Quit
The quit command uses the single character q as the command token. In the event the quit command is invoked, the program exits. There is no requirement for data persistence.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place?
Answers: 1
question
Computers and Technology, 22.06.2019 22:50
Which is the best minecraft server? a. mineplex b. worldonecraft c. 9b9t d. 2b2t
Answers: 2
question
Computers and Technology, 23.06.2019 01:30
Negative methods of behavior correction include all but this: sarcasm verbal abuse setting an example for proper behavior humiliation
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Name the range function that would generate the following list of integers values: 0,1,2,3,4,5.
Answers: 1
You know the right answer?
Build a Java program that will support the creation of a Binary Search Tree, hereinafter referred to...
Questions
question
Mathematics, 13.04.2020 17:43
question
Mathematics, 13.04.2020 17:43
Questions on the website: 13722367