Question 1966 – Nielit STA 17-12-2017
December 10, 2023Question 1975 – Nielit STA 17-12-2017
December 10, 2023Question 1971 – Nielit STA 17-12-2017
Given two sorted list of size ‘m’ and ‘n’ respectively. he number of comparisons
needed in the worst case by the merge sort algorithm will be:
Correct Answer: D
Question 49 Explanation:
→ To merge two lists of size m and n, we need to do m+n-1 comparisons in worst case.
→ Since we need to merge 2 at a time, the optimal strategy would be to take smallest size lists first.
→ The reason for picking smallest two items is to carry minimum items for repetition in merging.
→ Since we need to merge 2 at a time, the optimal strategy would be to take smallest size lists first.
→ The reason for picking smallest two items is to carry minimum items for repetition in merging.
m*n
minimum of m,n
Maximum of m,n
M+n-1
Subscribe
Login
0 Comments