COMPSCI 61A Lecture Notes - Lecture 4: Dwindle Distribution

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

Document Summary

An the environment diagram is used to keep track of all variable and functions. X=l def fun ( c i an global variables def are stored global. X=2 def fun global y=o func parent x u return. 2 assignment: evaluate statement y lo the return e the side of b) write value in the current variable name frame expression on right and the expression "s, defining create a, [ parent a. = global indicates where the function was first defined: most function frames will have a return value. It can be broken is any function which calls itself into. Sections: base case the simplest version of problem, recursive can : where the function. Calls itself on a smaller input c) value. Mechanism : the final the recursive call and of return value is typically a one more value def factorial factorial. Recursive inpmrnnf return case num else ( numh factorial. Err or if return else return some valuetrecursivecan.

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