Aspire's Library

A Place for Latest Exam wise Questions, Videos, Previous Year Papers,
Study Stuff for MCA Examinations - NIMCET

Previous Year Question (PYQs)



Arrange the following search and sort algorithms in ascending order of their worst-case complexities.

A. Merge sort
B. Linear Search
C. Bubble Sort
D. Binary Search

Choose the correct answer from the options given below:





Solution

Worst-case complexities are:

Binary Search $=O(\log n)$

Linear Search $=O(n)$

Merge Sort $=O(n\log n)$

Bubble Sort $=O(n^2)$

Ascending order:

$O(\log n) < O(n) < O(n\log n) < O(n^2)$

So,

D, B, A, C

Correct option is:

$\boxed{(a)\ D,B,A,C}$



Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More


Online Test Series,
Information About Examination,
Syllabus, Notification
and More.

Click Here to
View More

Ask Your Question or Put Your Review.

loading...