Question DSA-REC-0072
HardA recursive function calls itself twice on n/2 and does O(1) work. How many calls are made in total for n = 2^k?
- A.
2^k
- B.
k²
- C.
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Recursion and Backtracking question
A recursive function calls itself twice on n/2 and does O(1) work. How many calls are made in total for n = 2^k?
2^k
k²
Sign up free to see the answer and a step-by-step explanation.
2^(k+1) − 1
k