...
Question 22 – ISRO-2018
February 13, 2024
GATE 1995
February 13, 2024
Question 22 – ISRO-2018
February 13, 2024
GATE 1995
February 13, 2024

GATE 1995

Question 16

For merging two sorted lists of sizes m and n into a sorted list of size m+n, we required comparisons of

A
O(m)
B
O(n)
C
O(m+n)
D
O(logm+logn)
Question 16 Explanation: 
In best case, no. of comparisons is Min(m,n).
In worst case, no. of comparisons is m+n-1.
Then we require O(m+n) comparisons to merging two sorted lists.
Correct Answer: C
Question 16 Explanation: 
In best case, no. of comparisons is Min(m,n).
In worst case, no. of comparisons is m+n-1.
Then we require O(m+n) comparisons to merging two sorted lists.

Leave a Reply

Your email address will not be published. Required fields are marked *