Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Type and compile the following files from chapter 25: Tree.java, AbstractTree.ja

ID: 3858231 • Letter: T

Question

Type and compile the following files from chapter 25: Tree.java, AbstractTree.java, and BST.java. Type, compile, and run the following programs from chapter 25: TestBST.java and TestBSTDelet.java. All code must be working before you working on part 2 below. Note that you may need to include class TreeNode.java. Code may vary among different versions of the textbook. Following the test programs above, write a new test program called RemoveDuplicates.java. The program reads words from a text file (or a string) and adds the words to a BST. The program then traverses the BST and prints out the words in order on the screen or to a text file. Note that you may need to make some changes to BST.java. A sample test output: ------- -jGRASP exec: java -ea RemoveDuplicates Original Text: this is a test for the test in the program that does no test Processed Text: a does for in is no program test that the this -------------jGRASP: operation complete.

Explanation / Answer

q.insert(k); is a statement. Statements need to be in methods, it isn't currently in a method.

So do something like:

Note the signature I used for the method. This is the signature that Java sees as the entry method (where the program will start).