Grading Criteria
For transparency’s sake, below is a list of aspects of your code the automated tests will check. Your code will still be checked by a TA, and passing all these tests does not guarantee a perfect grade.
This may appear to be a large number of tests, but if you follow the guidelines set in the method headers and this writeup, you should already be passing most of, if not all of these tests:
Do Term's compareTo and Comparator inner classes sort correctly?
Does Term's constructor initialize correctly and throw exceptions when appropriate?
Does Term.PrefixOrder(r).compare() take O(r) time?
Do BinarySearchAutocomplete and TrieAutocomplete's topMatch and topKMatches return the correct results?
Do BinarySearchAutocomplete and TrieAutocomplete's topMatch simply call topKMatches?
Can BinarySearchAutocomplete and TrieAutocomplete's topMatch and topKMatches handle an empty string argument?
Do BinarySearchAutocomplete and TrieAutocomplete's topKMatches handle a k = 0 argument?
Do BinarySearchAutocomplete and TrieAutocomplete handle words with irregular character values correctly?
Do BinarySearchAutocomplete and TrieAutocomplete modify the values they are constructed from when they shouldn't?
Do BinarySearchAutocomplete and TrieAutocomplete use static variables unnecessarily?
Do BinarySearchAutocomplete and TrieAutocomplete's constructors, topMatch, and topKMatches throw NullPointerExceptions if an argument is null?
Do BinarySearchAutocomplete and TrieAutocomplete modify the values they are constructed from?
Do BinarySearchAutocomplete's firstIndexOf and lastIndexOf return the correct results?
Do BinarySearchAutocomplete's firstIndexOf and lastIndexOf handle empty arrays?
Do BinarySearchAutocomplete's firstIndexOf and lastIndexOf use the correct number of compares?
Do BinarySearchAutocomplete's firstIndexOf and lastIndexOf use compare instead of equals?
Do BinarySearchAutocomplete's firstIndexOf and lastIndexOf change the value of their arguments when they shoudn't?
Does TrieAutocomplete's add generate the trie correctly?
Does TrieAutocomplete's add handle calls to the same word twice correctly?
Do TrieAutocomplete's topMatch and topKMatches avoid exploring more
nodes than needed?
Grading
This assignment is worth 40 points.
- 70% Correctness: for your implementation of
Term, BinarySearchAutocomplete, and
TrieAutocomplete and passing the tests described above.
- 17.5% Analysis: for your README, data from
AutocompleteBenchmark. answers to the
questions, and description of the tradeoffs.
- 12.5% Engineering: for your the structure and style of
your Autcompletor implementations. Is your code inefficient?
</ul>