61A Fall 2020 Lecture 8 Q&A

preview_player
Показать описание
00:03 What happens when you print after making a recursive call, like the cascade function?

03:53 How does luhn_sum work, and what is mutual recursion in general?

10:21 In luhn_sum, where do we check whether doubling results in a number greater than 9?

11:00 For every recursive call, do you always go down the frames in the environment and then back up?

11:33 What's the difference between recursion and self reference?

13:43 Follow-up: What about self-reference of a function within another function?

15:00 Is it better to use if/else or just if when writing a recursive function?

17:23 When do you need to return the result of a recursive call?

19:14 When is it a good idea to use a mutually recursive implementation?

20:33 What would luhn_sum look like if it were implemented iteratively?

22:38 Do elif clauses appear in recursive functions?

24:06 What does it mean to "preserve state"?

25:26 How difficult or complicated will recursion problems get in this course?

27:33 How do you verify that mutually recursive functions are correctly implemented?
Рекомендации по теме