Saint Louis University |
Computer Science 180
|
Dept. of Math & Computer Science |
Topic: List and Sequence ADT
Related Reading: Ch. 5.2-5.3 and 5.5-5.6
Due:
Tuesday, 11 April 2006, 1:10pm
Please make sure you adhere to the policies on academic integrity.
Using the List interface methods, use recursion to implement a function
which determines whether value k is on the list. You may assume that the equality operator (==) is defined for the Object type..bool search(const List<Object>& L, Object k)
If the public signature is inconvenient, you are free to define your own private method for the recursion, so long as the public interface is supported.
How much auxillary space does your function use in addition to the space used for L?
Creativity Exercise C-5.12 of the text.
(Hint available through
Hint Server
on textbook's website).
The document has moved here.