Data Structures and Algorithms - Performance Analysis of Algorithms and Recurrences

Avatto > > UGC NET COMPUTER SCIENCE > > PRACTICE QUESTIONS > > Data Structures and Algorithms > > Performance Analysis of Algorithms and Recurrences

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

  • Option : C
  • Explanation :
    We use merge sorting and finally we get comparison O (m + n)
Cancel reply
Cancel reply

118. 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?

  • Option : B
  • Explanation :
    Time complexty is O (nlogn)
    C * 64 log 64 = 30
    (C = 5/14)
    for 6 minuts
    5/64 * n log n 6 * 60 ⇒ [n = 512]
Cancel reply
Cancel reply

119. Match the pairs in the following:

List-IList-II
A.Straseen's matrix multiplication algorithmP.Greedymethod
B.Kruskal's minimum spanning tree algorithmQ.Dynamic programming
C.Biconnected components algorithmR.Divide and Conquer
D.Floyd's shortest path algorithmS.Depth first search

  • Option : A
  • Explanation :
    A – R, B–P, C–S, D–Q
Cancel reply
Cancel reply

120. The minimum number of comparisons required to sort 5 elements is

Cancel reply
Cancel reply