Question:

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

Show Hint

In general, the time complexity of sorting algorithms like merge sort and bubble sort is $O(n \log n)$ and $O(n^2)$ respectively.
Updated On: Sep 25, 2025
  • (A), (B), (C), (D)
  • (B), (C), (D), (A)
  • (B), (C), (A), (D)
  • (C), (B), (D), (A)
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is D

Solution and Explanation


Step 1: Understand the time complexities.
- **Bubble sort (worst case)** (A): The worst-case time complexity of bubble sort is **$O(n^2)$**.
- **Deleting head node in singly linked list** (B): Deleting the head node takes **$O(1)$** time.
- **Binary search** (C): Binary search has a time complexity of **$O(\log n)$**.
- **Worst case of merge sort** (D): Merge sort has a worst-case time complexity of **$O(n \log n)$**.

Step 2: Arrange in increasing order.
From lowest to highest, the correct order is: - **(C)** Binary search: $O(\log n)$ - **(B)** Deleting head node: $O(1)$ - **(D)** Merge sort: $O(n \log n)$ - **(A)** Bubble sort (worst case): $O(n^2)$

Step 3: Conclusion.
Thus, the correct order is **(C), (B), (D), (A)**.

Was this answer helpful?
0
0

Questions Asked in CUET PG exam

View More Questions