CS 635 Advanced Object-Oriented Programming
Spring Semester, 2007
Assignment 3
© 2007, All Rights Reserved, SDSU & Roger Whitney
San Diego State University -- This page last updated 2/27/07
Assignment 3
Due March 13
Modify your Binary Search Tree that uses Null object to accept a Visitor . Implement a Visitor to produce the following representation of a search tree. Each node maps to (Value (Left Subtree)(Right Subtree)). So the representation of the tree below is (5 (3 () (4 () ()))(10 () ())).
Use the Strategy pattern so that clients can provide an ordering that the tree will use to order its elements. Implement two orderings. The first ordering is the normal lexicographic (or alphabetic) ordering for strings. The second ordering compares strings by first reversing the string and then comparing the strings lexicographically. In the second ordering "az" would come after "bb".
Grading
Item |
Percent of Grade |
Working Code |
15% |
Unit Tests |
10% |
Proper implementation of Patterns |
60% |
Quality of Code |
15% |
Proper implementation of Patterns. The goal of the assignment is to better understand the iterator and null object patterns. So 60% of your grade is on producing a proper implementation of the patterns.
What to Turn in
Turn in hard copy of your code and unit tests.
Late Policy
The penalty for turning in the assignment late is 3% of the grade per day. Once solutions to the assignment have been posted or discussed in class no more late assignments will be accepted.