|
|
CS 420/520: Object-Oriented Programming |
|
|
|
Assignment 3: Implement a Trie |
|
|
Set: Monday 19th October 2000 Code due: Thursday 29th October 2009 at or before midnight |
|
SummamaryIn the class repository on SqueakSource you will find a unit test (class TrieTest) for a data structure called a Trie. Your assignment is to implement a class Trie so that the all tests pass. GroupsIt is best to do this assignment as a pair. I will also accept assignment form individuals. Groups of three or more are NOT PERMITTED. What's a TrieA trie, (pronounced "tree", from the word re-trie-val, or "try", for differentiation), is a prefix tree useful for implmenting sets of strings, or dictionaries whose keys are strings. There is a good description in Wikipedia. But in fact, the tests will tell you what to implement: if they all passs, and the structure that you built is a prefix tree, you can't have gone too far wrong. What I'm looking ForHere is the grading rubric. As far as fucntionality goes, consider the tests to be a specification. For example, here is a test:
This tells you that ties understand the size message, the includesKey: message, and the at: message, as well as the add: message. It tells you that a trie behaves like a dictionary, and that adding a key without an associated value implicitly associates nil withthe key. It aslso tells you that the result of adding a key is the key itself. If there are still ambiguities in th ebehavior of tries, ask me about them; I'll respond by adding more tests. Getting the TestsVisit the class repository
and load the package 'Trie-Tests' Hints
Submitting your workSubmit your work as a Monticello version (a .mcz file) by email to cs520-hw, with a subject line like this:
|
Most recently modifed by Andrew P. Black on