INTRODUCTION/RECURSION Flashcards

1
Q

is a procedure to accomplish a specific task.

A

ALGORITHM

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

It must solve a general, well-specified problem.

A

ALGORITHM

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

typically involves input data, a set of rules or constraints, and a desired output.

A

ALGORITHMIC PROBLEM

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

WHAT IS A GOOD ALGORITHM

A

CORRECT
EFFICIENT
EASY

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

is a way/process of defining a function to call itself, using
smaller inputs.

A

RECURSION

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

Every iterative procedure can be converted to a recursive
function.

A

RECURSION

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

Algorithms are naturally recursive.

A

RECURSION

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

A function that uses recursion is called

A

RECURSIVE FUNCTION

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

calls itself with smaller input values
and returns the result for the current input by carrying out
basic operations on the returned value for the smaller
input.

A

RECURSIVE ALGORITHM

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

COMPONENTS OF RECURSIVE ALGORITHM

A

BASE CASE
RECURSIVE CASE
RECURSIVE CALL
RETURN VALUE

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

This is the condition that terminates the recursive calls and
returns a result.

A

BASE CASE

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

It is usually the simplest form of the problem that can be
solved without further recursion.

A

BASE CASE

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

This is the part of the algorithm that calls itself with a
smaller or simpler instance of the same problem.

A

RECURSIVE CASE

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

makes progress towards the base case by breaking down the problem into smaller sub-problems.

A

RECURSIVE CASE

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

This is the actual call to the function itself with modified
input parameters.

A

RECURSIVE CALL

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

It is the core of the recursion and allows the algorithm to
make progress towards the base case.

A

RECURSIVE CALL

17
Q

This is the value that is returned by the function at each
level of recursion.

A

RETURN VALUE

18
Q

It is usually a combination of the return value of the
previous level of recursion and the result of the current level of recursion.

A

RETURN VALUE

19
Q

is an efficient algorithm for finding an item from a sorted list of items.

A

BINARY SEARCH