Assume that a mergesort algorithm in the worst case takes 30 seconds for an input of size 64.

Which of the following most closely approximates the maximum input size of a problem that can be solved in 6 minutes?

This question was previously asked in
GATE CS 2015 Official Paper: Shift 3
View all GATE CS Papers >
  1. 256
  2. 512
  3. 1024
  4. 2048

Answer (Detailed Solution Below)

Option 2 : 512
Free
GATE CS Full Mock Test
65 Qs. 100 Marks 180 Mins

Detailed Solution

Download Solution PDF

Concept:

Merge sort algorithm worst case time complexity is O (nlogn)

Data:

T1 (n) =30 seconds, n1 = 64

T2 (n) = 6 minutes

Formula:

T(n) = nlog2n

Calculation:

30 = c × 64 log2(64)

30 = c × 64 log2(26)

30 = c × 64 × 6

6 × 30 = c n2 log2n2

∴ n2 = 512

The maximum input size of a problem that can be solved in 6 minutes is 512

Latest GATE CS Updates

Last updated on Jan 8, 2025

-> GATE CS 2025 Admit Card has been released on 7th January 2025.

-> The exam will be conducted on 1st February 2025 in 2 shifts.

-> Candidates applying for the GATE CE must satisfy the GATE Eligibility Criteria.

-> The candidates should have BTech (Computer Science). Candidates preparing for the exam can refer to the GATE CS Important Questions to improve their preparation.

-> Candidates must check their performance with the help of the GATE CS mock tests and GATE CS previous year papers for the GATE 2025 Exam.

More Sorting Questions

Hot Links: teen patti real cash apk teen patti online teen patti gold online teen patti mastar teen patti all