See also: complexity analysis
LinearSearch(L, v, o)
: potentially-high cost
recursive binary search:
repetition → induction
Induction hypothesis:
Recursive case: mid := (begin + end) div 2
:
termination bound function:
Complexity:
Complexity: . Assume , work = 1
Can usually assume
Theorem
LowerBoundRec
is correct and runtime and memory complexity of