Saint Louis University |
Computer Science 150
|
Dept. of Math & Computer Science |
Topic: Recursion
Related Reading: Chapter 11
Due:
9:00am, Friday 23 April 2010
Please make sure you adhere to the policies on academic integrity.
Exercise 11.9 of the text
Exercise 11.10 of the text
Exercise 11.24 of the text
Exercise 11.29 of the text
Recall that the syntax data[i:j] returns a new list which is a slice of the original list, starting with the element at index i and going up to but not including the element at index j. Behind the scene, that is supported by the __getitem__ method, with the parameter appearing as a special instance of a class named slice.
However, there is deprecated support, from older versions of Python,
allowing you to override the slicing behavior by implementing a
special method with signature
Provide a recursive implementation of
Remember that the original list should not be mutated when
computing a slice, or subseuqently modifying that computed slice.