Introduction to Evaluation of Algorithms Flashcards
which is more efficient for searching brute force linear search or binary search
binary search
best case scenario loop iterations of linear search
1
the number we are searching for is the first number in the array
worst case scenario loop iterations for linear search
array length
number we are searching for is the last number in the array or is not in the array at all
worst case scenario loop iterations for binary search
logN
the number we are searching for isnt found until there is only one number left
best case scenario loop iterations for binary search
1
the number we are searching for is directly in the middle of the array
two methods for calculating order of growth
scientific method (experimental approach)
cost models (mathematical approach)
two methods for calculating order of growth
scientific method (experimental approach)
cost models (mathematical approach)
what are the system independent effects on run time
algorithm
input size
What are the system dependent effects on run times
hardware (cpu, memory, cache)
software (compiler, interpreter, garbage collector)
system (operating system, network)