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

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


Cancel reply

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


117. If one uses straight two-way merge sort algorithm to sort the following elements in ascending order:
20, 47, 15, 8, 9, 4, 40, 30, 12, 17
then the order of these elements after second pass of the algorithm is?

Cancel reply

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


Cancel reply

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


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

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


Cancel reply

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


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

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


Cancel reply

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


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

Cancel reply

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


Cancel reply

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