Exercise 2: An ordered Binary Tree (of integers) Deadline: Friday 26th November at 5 o'clock 0. This exercise is based on material from Chapter 5 of Goodrich and Tamassia 1. Make a directory to work in, and then copy across the files BTree.java, Ex2.class, Node.java, Readme, Test.java, and trace 2. Look at the source code BTree.java and Node.java and implement the methods required (by editing the file you copied down). The methods to implement are: - size() - sum() - max() - isPresent(e) - height() See BTree.java source code for the specification, and look at Node.java for further information. 3. Look at file trace to see two sample Test runs on a BTree and an empty BTree. 4. Implement these method, and compile all the files - javac Test.java 5. Manually test your methods, by running the Test program - java Test NOTE: you can examine the BTree in Test by using the commands root, left, and right. A "current node" is maintained, and you can move this about the BTree. NOTE: when testing your methods you should draw out (on paper) the BTree you are constructing, and verify this with the root/left/right commands. NOTE: you should look at file trace to see a trial execution of the Test program. 6. When you think things are going okay, use the "black box" tester program Ex2.class That is, run Ex2 to apply my test data against your methods. This will deliver a mark for you. - java Ex2 7. When you are satisfied with your mark - copy your files BTree.java and Node.java to your cs233lab directory - change the access on the file >chmod 644 BTree.java >chmod 644 Node.java - use the command cs233check to check access rights etc 8. After the deadline, I will automagically copy across your source files, compile them, mark them, put the results on the course web pages, and then perform plagiarism detection. 8. PLEASE NOTE: keep an eye on the web pages, in particular http://www.cs.strath.ac.uk/teaching/ug/classes/233/News.html and the newsgroup, for any upd8's on the exercise (such as new marking programs, etc) Good luck Patrick