Outline for December 8, 2020

Reading: none>
Due: Homework 4, due December 8, 2020; Project, due December 18, 2020

  1. Thinking recursively [recfun.py]
    1. First: think of the problem in terms of something involving a smaller instance of the problem (recursive case)
    2. Next: decide when to stop (base case)
    3. Example: Find the length of a string
    4. Example: Find the maximum element of a list
    5. Example: Construct a string from a list of strings
    6. Example: Reverse a string

  2. Recursion
    1. Palindromes [palindrome.py]
    2. Fibonacci numbers [rfib.py]
    3. Sum of digits [sumdigits.py]
    4. Nested lists: is an item in a list? [isinlist.py]

UC Davis sigil
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email: mabishop@ucdavis.edu
MHI 289I, Programming for Health Informatics
Version of December 6, 2020 at 1:37PM

You can also obtain a PDF version of this.

Valid HTML 4.01 Transitional Built with BBEdit Built on a Macintosh