Assume that a mergesort algorithm in the worst case takes seconds for an input of size . Which of the following most closely approximates the maximum input size of a problem that can be solved in minutes?
View worked solution
Answer: B
The worst-case time complexity of the Mergesort algorithm for an input of size is given by:
where is a constant.
Step 1: Determine the constant
We are given that for , the time taken is seconds:
Step 2: Find the maximum input size for minutes
We want to find the maximum input size that can be solved in minutes ( seconds):
Step 3: Test the given options
- Option A ():
(Feasible, but we need the maximum size) - Option B ():
(Exactly matches the limit) - Option C ():
(Exceeds the limit)
Thus, the maximum input size that can be solved in minutes is .
Free practice · Your answers on this page are not saved.
