Exam 3: Recursion: the Mirrors

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

What is a base case?

(Essay)
4.8/5
(40)

What is a tail-recursive method?

(Essay)
4.9/5
(44)

A ______ is a mathematical formula that generates the terms in a sequence from previous terms.

(Multiple Choice)
4.9/5
(38)

A recursive solution that finds the factorial of n always reduces the problem size by ______ at each recursive call.

(Multiple Choice)
4.9/5
(33)

A class method is defined as ______.

(Multiple Choice)
4.8/5
(38)

What elements are included in a method's local environment?

(Essay)
4.9/5
(46)

In a sorted array,the kth smallest item is given by ______.

(Multiple Choice)
4.8/5
(36)

A binary search starts at the beginning of the collection of items.

(True/False)
4.8/5
(34)

What is a recurrence relation?

(Essay)
4.8/5
(32)

In the box trace for a recursive method,a new box is created each time ______.

(Multiple Choice)
4.9/5
(36)

A recursive solution solves a problem by solving a smaller instance of the same problem.

(True/False)
4.8/5
(39)

Write a recursive method that takes 3 parameters: an integer array a,and two integers first and last.The method will find the largest value in a between indices first and last,inclusive.That is,it will return the largest value in the part of the array a[first..last] .You may assume that first  last.

(Essay)
4.8/5
(30)

How does a sequential search work?

(Essay)
4.9/5
(35)

What would happen if a negative value is passed to a method that returns the factorial of the value passed to it?

(Multiple Choice)
4.8/5
(43)

In the recursive solution to the Towers of Hanoi problem,the number of disks to move ______ at each recursive call.

(Multiple Choice)
4.8/5
(41)

For anArray = <2,3,5,6,9,13,16,19>,what is the value returned by a recursive binary search algorithm if the value being searched for is 10?

(Multiple Choice)
4.9/5
(31)

For anArray = <2,3,5,6,9,13,16,19>,what is the value returned by a recursive binary search algorithm if the value being searched for is 6?

(Multiple Choice)
4.7/5
(41)

A recursive solution that finds the factorial of n generates ______ recursive calls.

(Multiple Choice)
5.0/5
(38)

What is the box trace?

(Essay)
4.9/5
(38)

In a recursive method that writes a string of characters in reverse order,the base case is ______.

(Multiple Choice)
4.8/5
(37)
Showing 21 - 40 of 60
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)