COMPSCI 61A Lecture Notes - Lecture 4: Iterated Function, Luhn Algorithm

37 views1 pages
zogo39484755 and 6 others unlocked
COMPSCI 61A Full Course Notes
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents

Document Summary

You may bring 1 two-sided page of hand-written notes that you create yourself. Practice exam will be posted later this week. Additional topic lectures wednesday 5-6:30pm for an additional unit. A recursive function is a function whos body calls itself either directly or indirectly. The def statement header is similar to other functions. Each time you call a function in recursion you create a new frame with the same parent as the first function call. Multiple frames keep track of the different arguments in each call. What each variable evaluates to depends upon which is the current environment. Each call to the function solves a simpler problem than the last (the index decreases) Iteration is a special case of recursion (while and loops vs recursion) To test verify if a recursive function is implemented correctly. Verify that (n) is correct assuming that (n-1) is correct. Occurs when two functions mutually call each other.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents