Download presentation
1
Chapter 6 Questions Quick Quiz
True or False: Every (recursive) call also has its own set of parameters and local variables. Answer: True If every recursive call results in another recursive call, then the recursive function (algorithm) is said to have ____ recursion. Answer: infinite
2
Questions Every recursive definition must have at least ____ base case(s). Answer: one True or False: If a recursive solution to a problem exists, a programmer should always opt to use it over any iterative solution that exists. Answer: False
3
Questions ____ control structures use a looping structure to repeat a set of statements. Answer: Iterative Every ____ call requires that the system allocate memory space for its formal parameters and local variables and then deallocate the memory space when the function exits. Answer: recursive
4
Questions True or False: It is difficult to construct an iterative solution for the Tower of Hanoi problem. Answer: True The ____ algorithm attempts to find solutions to a problem by constructing partial solutions and then making sure that any partial solution does not violate the problem requirements. Answer: backtracking
5
Questions A function is called ____ recursive if it calls itself.
A function is called ____ recursive if it calls itself. Answer: directly
6
Text True or False: There are usually two ways to solve a particular problem: iteration and recursion. Answer: True
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.