Computers and Technology

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.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 02:20, eagles2286
The reset circuit used on the four 3-bit counters analyzed in this activity reset the counts to zero (000). it makes sense for the up-counters to start at zero (000), but the down-counters should start at seven (111). what would you need to change so that the 3-bit binary down counter with j/k flip-flops you just created would reset to seven (111)?
Answers: 1
image
Computers and Technology, 22.06.2019 10:00, hailee232
What is a society that has moved to the internet rather than relying on physical media called
Answers: 2
image
Computers and Technology, 22.06.2019 11:00, Yamari000
What are two of the most common reasons that peolpe who need mental health care do not access it?
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, GEEKLIFE6598
After you present a proposal, the committee starts asking you questions, some beyond the strict focus of your proposal. they ask questions about implications in other fields and knowledge about other fields. you are asked to redo your proposal. what is most likely missing? breadth of material depth of material clarity of material details of material
Answers: 1
Do you know the correct answer?
Build a Java program that will support the creation of a Binary Search Tree, hereinafter referred to...

Questions in other subjects:

Konu
History, 20.10.2019 15:10