Assignment 5 - Additional Hints and Clarification
Assignment 5 - Additional Hints and Clarification
The timing program sets up the data needed to perform the timing tests, runs the timing tests and collects the timing data, then reports on the results. When you cannot estimate how long the timing tests will run, it helps if you also print the results of each test, as soon as it completes.
You should test the behavior of the methods: bt.build, bt.contains, and the behavior of the Iterator produced by the bt.iterator() method (while(it.hasNext()){ it.next(); }).
You will having timing tests for each possible combination of the behaviors/operations above, files, number of words, and Comparators. For example, for the testing on lists of words there are three operations, four files, six different number of words/data set sizes, and three Comparators. This would result in 216 different timing tests and timing results. For the testing on classical literature there are three operations, two files, and three Comparators, which would result in 18 different timing tests and timing results.
Rather than writing out over 200 different timing tests, your timing program should use methods, fields, and/or loops to perform the timing tests.
The timing tests for the bt.contains method check the time it takes to find an item in the binary search tree. The file contains.txt provides for you the Strings that you should look for. Again, record the time you need to find all 100 Strings in each of the data sets you have built earlier.
As stated in class, you will be writing your own timing program. You will not be using JUnit or the Tester library as you are not writing that type of test. Instead you are writing a program to collect the timing data.
System.currentTimeMillis() will be helpful you when completing the timings.
http://docs.oracle.com/javase/6/docs/api/java/lang/System.html
Last Updated on October 17, 2013