Q1: Solving a problem by recursion is not only popular in computer science and math. Name some examples from the fields of business or economics where problems are also solved in a backward fashion!
< your answer >
Q2: Explain what duck typing means! Why can it cause problems? Why is it not a bug but a feature?
< your answer >
Q3: What is syntactic sugar?
< your answer >
Q4: Describe in your own words why the recursive version of fibonacci()
, the "Easy at first Glance" example in the chapter, is computationally inefficient! Why does the iterative version of fibonacci()
, the "Hard at first Glance" example, run so much faster?
< your answer >
Q5: What is the conceptual difference between a container and a list?
< your answer >
Q6: What is a good use case for the for
-loop's optional else
-clause?
< your answer >
Motivate your answer with one short sentence!
Q7: When a recursion does not reach the base case, this is an example of the early exit strategy.
< your answer >
Q8: Any programming language without looping constructs like the for
or while
statements is not Turing complete.
< your answer >
Q9: A recursive formulation is the same as a circular one: The terms are synonyms.
< your answer >
Q10: Formulating a computational problem as a recursion results in an efficient implementation.
< your answer >
Q11: Whereas a recursion may accidentally result in a never-ending program, while
-loops and for
-loops are guaranteed to terminate.
< your answer >
Q12: Before writing any kind of loop, we always need to think about a stopping criterion ahead of time.
< your answer >
Q13: Container types such as list
objects are characterized by their support for being looped over, for example as in:
for element in container:
# do something for every element
...
< your answer >