Inputs
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
---|---|---|---|---|---|---|---|
1 | 3 | 9 | 10 | 14 | 19 | 20 | 21 |
K = 21, i = 0, j = 7
Algo
Time Complexity
Let Input Size = n
Recursive Equation
T(n) = T(n/2) + O(1)
Recursion Tree
n --- O(1)
n / 2 --- O(1)
n / 4 --- O(1)
n / 8 --- O(1)
.
.
1
Height of the Tree