Department of Computer Science 1 Chapter 6 Questions Quick Quiz True or False: Every (recursive)...
-
Upload
estella-malone -
Category
Documents
-
view
218 -
download
0
Transcript of Department of Computer Science 1 Chapter 6 Questions Quick Quiz True or False: Every (recursive)...
Department of Computer Science 1
Chapter 6 QuestionsQuick 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
Department of Computer Science 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
Department of Computer Science 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
Department of Computer Science 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
Department of Computer Science 5
Questions
A function is called ____ recursive if it calls itself.Answer: directly
Department of Computer Science 6
Text
True or False: There are usually two ways to solve a particular problem:
iteration and recursion.Answer: True