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?

 


 

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?

 (A) 256
(B) 512
(C) 1024
(D) 2048


Answer: (B)

Explanation:

Time complexity of merge sort is Θ(nLogn)

c*64Log64 is 30
c*64*6 is 30
c is 5/64

For time 6 minutes

5/64*nLogn = 6*60

nLogn = 72*64 = 512 * 9

n = 512. 

Comments

Popular posts from this blog

how to download and install secure exam browser for Accenture test

How to create Simple Company Website with Admin Panel in PHP | Free Source Code Download

SAP Labs Hiring Associate Developer (2022/2021 Batch)

Capgemini Engineering PSS hiring for-Engineering MCA Batch 2020/2021/2022

Amazon Hiring Cloud Support Associate (2022/2021 Batch)