GATE 2016 CS (CS2) – Question 49
The flowchart defines recursive function A(n). Other statements cost O(1). If worst-case time is $O(n^\alpha)$, find the least α to two decimal places.

Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: 2.2 to 2.4
Explanation
The longest execution path calls A(n/2) six times: twice initially, twice along the middle branch, once below, and once on the final left branch. Hence $T(n)=6T(n/2)+O(1)$. The master theorem gives $\alpha=\log_2 6=2.58496$, rounded 2.58.
More Asymptotic Analysis and Time/Space Complexity questions
- GATE 2017 CS (CS2) Q13
- GATE 2017 CS (CS2) Q40
- GATE 2017 CS (CS2) Q48
- GATE 2012 CS (CS1) Q15
- GATE 2012 CS (CS1) Q28
- GATE 2013 CS (CS1) Q40
All Asymptotic Analysis and Time/Space Complexity questions →