constant A When the last action in a recursive method is a recursive call, it is calledĭ. O(log n) A The rate of growth for the Towers of Hanoi problem as the number of disks increases isĭ. O(n^2) A The efficiency for solving the Towers of Hanoi problem recursively isĭ. it cannot be proven A The efficiency for recursively calculating x^n isĭ. base case A The efficiency for recursively traversing a chain of linked nodes isĭ. ![]() is easy to do iteratively D To determine the efficiency of a recursive method you need to solve a(n)ĭ. is easier to do iteratively than recursivelyĭ. is easier to do recursively than iterativelyī. divides the chain in half placing the middle node in the right chain A Traversing a chain of linked nodesĪ. divides the chain in half placing the middle node in the left chainĭ. A A recursive method that processes a chain of linked nodesĬ. Should a for-loop be included in the method?ĭ. If the method returns a value, does each of the cases return a value?ī. Is at least one of the cases a base case that has no recursive call?Ī. Does each base case produce a result that is correct for that case?Ĭ. D What question should you keep in mind when debugging a recursive method?Ī. Does the method contain a statement to test an input value and leads to different cases?ĭ. all of the above A What question should you keep in mind when debugging a recursive method?Ĭ. ![]() all of the above A Recursive methods need a(n)ĭ. are useful when each recursive all is a solution to a smaller, identical problem **ĭ. none of the above C Recursion can be used to solve problems likeĪ. infinite recursion A What happens when a recursive method does not reach the base case?ĭ. baseless recursion A When too many recursive calls are made creating more activation records than the allocated program memory can handle, what kind of error occurs?ĭ. dynamic method A The condition when a recursive method does not satisfy a base case it is calledĭ.
0 Comments
Leave a Reply. |