2 votes 2 votes merge sort algo takes 30sec for input size of 64 in worst case, then max input size solvabe in 6 minutes? 512 64 1024 2048 Algorithms merge-sort time-complexity + – gate_forum asked Dec 13, 2015 • retagged Jun 22, 2022 by makhdoom ghaya gate_forum 1.5k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 4 votes 4 votes Worst case of merge sort = n * log n For n = 64, it takes 30sec: => 30 = k * (64 * log 64) => k = 0.078125sec. Therefore, in 6 min. = 6*60sec. = 360sec. => 360 = 0.078125 * n * log n => n * log n = 4608 => n = 512. monanshi answered Dec 13, 2015 • selected Dec 13, 2015 by Arjun monanshi comment Share Follow See all 3 Comments See all 3 3 Comments reply srestha commented Dec 13, 2015 reply Follow Share plz tell n * log n = 4608 log n^n =4608 now how u got n value? plz elaborate calculation 0 votes 0 votes monanshi commented Dec 13, 2015 reply Follow Share I don't know formal way to do it. I just tried few combinations. Finally, n=29 worked. 0 votes 0 votes ajay ajay.k commented Jun 23, 2016 reply Follow Share Substitute the answers in the place of n. 0 votes 0 votes Please log in or register to add a comment.