Outline for May 15, 2014

Reading: text, §18
Due: Homework #3, due May 21, 2014
  1. Work through the homework assignment
  2. Recursion
    1. Nested lists: is an item in a list? [isinlist.py]
    2. Palindromes [palindrome.py]
  3. 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
  4. Searching a list
    1. Example use: linear search [linsearch.py]
    2. Example use: recursive linear search [rlinsearch.py]
  5. Speed: compare iterative and recursive Fibonacci programs [timefibs.py]

You can also obtain a PDF version of this. Version of May 14, 2014 at 11:48PM