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 time complexities in increasing order.
(A). Bubble sort (worst case) 

(B). Deleting head node in singly linked list 

(C). Binary search 

(D). Worst case of merge sort 

Choose the correct answer from the options given below: 
1. (A), (B), (C), (D) 
2. (B), (C), (D), (A) 
3. (B), (A), (D), (C) 
4. (C), (B), (D), (A)





Solution

Step 1: Note the time complexities
(A) Bubble Sort (worst case): \(O(n^2)\)
(B) Deleting head node in singly linked list: \(O(1)\)
(C) Binary Search: \(O(\log n)\)
(D) Merge Sort (worst case): \(O(n \log n)\)

Step 2: Arrange in increasing order
\[ O(1)\;<\;O(\log n)\;<\;O(n \log n)\;<\;O(n^2) \] So: \[ (B)\;<\;(C)\;<\;(D)\;<\;(A) \]


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