Outline for February 4

Reading: text, §10
Due: Homework 2, due on February 4 at 11:55pm — note extension


  1. List example [addup.py]
  2. Thinking recursively [recfun.py]
    1. First: think of the recursive case (write the problem in terms of something involving a smaller instance of the problem)
    2. Next: think of base case (when to stop)
    3. Example: Find the length of a string
    4. Example: Does the string only have alphabetic characters in it?
    5. Example: Find the maximum element of a list
    6. Example: Construct a string from a list of strings
    7. Example: Reverse a string

UC Davis seal
Matt Bishop
Office: 2209 Watershed Science
Phone: +1 (530) 752-8060
Email: [email protected]
You can also obtain a PDF version of this.
Version of February 1, 2019 at 8:09PM