

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 7
click for more info
Not enough gems
Cost: 6 gems
1: Polynomial vs. Exponential
incomplete
2: Polynomial Time = P
incomplete
3: Reduction to P
incomplete
4: Order K^N – Exponential
incomplete
5: Big O Categories Review
incomplete
6: Complexity Quiz - Example 1
incomplete
7: Complexity Quiz - Example 2
incomplete
8: Complexity Quiz - Example 3
incomplete
9: Exponential Growth Sequences
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Consider the following code. It calculates the number of times a given number can be divided by 2 before becoming less than or equal to 1.
def naive_log2(x: int) -> int:
count = 0
while x > 1:
x /= 2
count += 1
return count