Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
- English ruler: drawInterval(L) = drawInterval(L−1), a tick of length L, drawInterval(L−1).
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
- Binary search halves the search range each call.
Exam weight Low
Exam weight
High
- Binary search runs in O(log n).
🎯 How this can come up · 1 question
MCQ
Binary search on a sorted array of n elements is:
Correct: O(log n).
Exam weight Low
- Linear recursion: at most one recursive call per invocation (sum, reverse array).
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight
Medium
- Recursive squaring: xⁿ = (x^(n/2))² → O(log n) multiplications.
Exam weight Low
Exam weight Low
- Tail recursion: the recursive call is the last step → easy to convert to a loop.
Exam weight Low
- Binary recursion: two recursive calls per non-base case.
Exam weight Low
Exam weight
High
- Naïve Fibonacci (binary recursion) is exponential: it recomputes the same values.
🎯 How this can come up · 1 question
True / False
The naïve recursive Fibonacci runs in linear time.
False. Exponential: about φⁿ calls.
Exam weight Low
Exam weight Low
- Better Fibonacci returns a pair (F(k), F(k−1)) → linear recursion, O(n).
Exam weight Low
Exam weight Low
Exam weight Low
Exam weight Low
No slides match this filter.