Introduction to Evaluation of Algorithms Flashcards

1
Q

which is more efficient for searching brute force linear search or binary search

A

binary search

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

best case scenario loop iterations of linear search

A

1

the number we are searching for is the first number in the array

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

worst case scenario loop iterations for linear search

A

array length

number we are searching for is the last number in the array or is not in the array at all

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

worst case scenario loop iterations for binary search

A

logN

the number we are searching for isnt found until there is only one number left

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

best case scenario loop iterations for binary search

A

1

the number we are searching for is directly in the middle of the array

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

two methods for calculating order of growth

A

scientific method (experimental approach)

cost models (mathematical approach)

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

two methods for calculating order of growth

A

scientific method (experimental approach)

cost models (mathematical approach)

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

what are the system independent effects on run time

A

algorithm

input size

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

What are the system dependent effects on run times

A

hardware (cpu, memory, cache)
software (compiler, interpreter, garbage collector)
system (operating system, network)

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