Question DSA-CX-0013
MediumWhich recurrence describes merge sort, and what does it solve to?
- A.
T(n) = T(n − 1) + O(1), which is O(n)
- B.
T(n) = T(n/2) + O(n), which is O(n²)
- 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
Complexity Analysis question
Which recurrence describes merge sort, and what does it solve to?
T(n) = T(n − 1) + O(1), which is O(n)
T(n) = T(n/2) + O(n), which is O(n²)
Sign up free to see the answer and a step-by-step explanation.
T(n) = 2T(n/2) + O(n), which is O(n log n)
T(n) = 2T(n/2) + O(1), which is O(log n)