next up previous
Next: Two silly recursive methods Up: Assignment 2: Recursion Previous: GDC redux

Print backwards

1.
Add a new method to the List class, called printBackwards, that prints the elements of a list in the same format as the print method, except that the elements should be in reverse order. Your method should be recursive. You will probaby want to write a helper method--you should give some thought to which class the helper method should be in. Also, it may be tricky to get the commas to print just right.



Allen B. Downey
1998-09-21