NEED A PERFECT PAPER? PLACE YOUR FIRST ORDER AND SAVE 15% USING COUPON:

SOLVED

11)In a recursive method that writes a string of characters in reverse order, the base case is ______. a)a string with a length of 0 b)a string whose length is a negative number c)a string with a length of 3 d)a string that is a palindrome 12)Which of the following is a precondition for a method that accepts a number n and computes the nth Fibonacci number? a)n is a negative integer b)n is a positive integer c)n is greater than 1 d)n is an even integer 13)How many bases cases will be required in a recursive solution that solves a problem by solving two smaller problems of the same type? a)0 b)1 c)2 d)3 14)The number of ways to choose k out of n things is ______. a)the number of ways to choose k – 1 out of n – 1 things b)the number of ways to choose k out of n – 1 things c)the sum of the number of ways to choose k – 1 out of n – 1 things and the number of ways to choose k out of n – 1 things d)the product of the number of ways to choose k – 1 out of n – 1 things and the number of ways to choose k out of n – 1 things 15)When you solve a problem by solving two or more smaller problems, each of the smaller problems must be ______ the base case than the original problem. a)closer to b)farther to c)either closer to or the same “distance” from d)either farther to or the same “distance” from 16)A recursive method that computes the number of groups of k out of n things has the precondition that ______. a)n is a positive number and k is a nonnegative number b)n is a nonnegative number and k is a positive number c)n and k are nonnegative numbers d)n and k are positive numbers 17)The midpoint of a sorted array can be found by ______, where first is the index of the first item in the array and last is the index of the last item in the array. a)first / 2 + last / 2 b)first / 2 – last / 2 c)(first + last) / 2 d)(first – last) / 2 18)If the value being searched for by a recursive binary search algorithm is in the array, which of the following is true? a)the algorithm cannot return a nonpositive number b)the algorithm cannot return a nonnegative number c)the algorithm cannot return a zero d)the algorithm cannot return a negative number 19)Which of the following is NOT a precondition for an array that is to be sorted by a recursive binary search algorithm? (first is the index of the first item in the array, last is the index of the last item in the array, and SIZE is the maximum size of the array) a)SIZE <= first b)0 <= first c)last <= SIZE – 1 d)anArray[first] <= anArray[first + 1] <= … <= anArray[last] 20)An array is a(n) ______. a)class b)method c)object d)variable

Solution:

15% off for this assignment.

Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!

Why US?

100% Confidentiality

Information about customers is confidential and never disclosed to third parties.

Timely Delivery

No missed deadlines – 97% of assignments are completed in time.

Original Writing

We complete all papers from scratch. You can get a plagiarism report.

Money Back

If you are convinced that our writer has not followed your requirements, feel free to ask for a refund.