Chapter 3 Flashcards

1
Q

Recursion

A

Breaks a problem into smaller identical problems

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Iteration

A
  1. A process that is repetitive

2. A single pass through a loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Sequential Search

A

An algorithm that locates an item in a collection by examining items in order, one at a time, beginning with the first item.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Binary Search

A

An algorithm that searches a sorted collection for a particular item by repeatedly halving the collection and determining which half could contain the number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Base Case

A

The known case in a recursive definition. Also called the basis or degenerate case.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Divide and conquer

A

A problem-solving strategy that divides a problem into smaller problems, each of which is solved separately.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Four Questions for Constructing Recursive Solutions

A
  1. How can you define the problem in terms of a smaller problem?
  2. How does each recursive call diminish the size of the problem?
  3. What instance of the problem can serve as the base case?
  4. As the problem size diminishes, will you reach the base case?
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Recurrence Relation

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Mathematical Induction

A

A method for proving properties that involve non-negative integers. Starting from a base case, you show that if a property is true for an arbitrary non-negative integer k, then the property is true for the integer k + 1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Box Trace

A

A systematic way to trace the actions of a recursive method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Activation Record

A

A record that contains a method’s local environment at the time of and as a result of the call to the method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Local Environment

A

A method’s local variables, a copy of the actual value arguments, a return address in the calling routine, and the value or the method itself.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Fibonacci Sequence

A

The sequence of integers 1, 1, 2, 3, 5, . . . defined by the recurrence relationship
a1 = 1, a2 = 1, an = an-1 + an-2 for n > 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Partition

A

To divide a data structure such as an array into segments.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Tail Recursion

A

A type of recursion in which the recursive call is the last action taken.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly