Data Structures

1: For merging two sorted lists of sizes m and n into a sorted list of size m + n, we require comparisons of  
A.

 

O(m)
 
B.

 O(n)

C.

O(m+n)

D.

O(log(m) + log(n))

 

Answer : C

Explanation :
Each comparison will append one item to the existing merge list. In the worst case one needs m + n - 1 comparisons which is of order m+n.

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.