Question: Write a Java method named FillTree that can fill a Binary Search Tree using 10 words that are read from the user via the keyboard.

Write a Java method named FillTree that can fill a Binary Search Tree using 10 words that are read from the user via the keyboard. The first two words should be your first name and last name. The other 8 words can be anything of your choice. The Binary Search Tree should come from the main method. The main method calls FillTree and pass it a Tree to be filled; (2 marks)
2. Write a Java method named displayTree. The main method will pass it the Tree created above and the way to display the Tree, such as postOrder and inOrder. Then displayTree will display the Tree as instructed by the main method; (2 marks)
3. Test the two methods FillTree and displayTree by calling them in the main method. Take a screenshot of the output screen. (1 mark)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!