Which of the following sorting algorithms has the lowest time complexity in…
2024
Which of the following sorting algorithms has the lowest time complexity in the best case scenario ?
- A.
Selection sort
- B.
Merge Sort
- C.
Insertion sort
- D.
Bubble sort
Attempted by 115 students.
Show answer & explanation
Correct answer: C
Insertion sort has the lowest best-case time complexity among the given conventional choices. When the input array is already sorted, insertion sort only checks each element against the previous one and performs no shifts, so it runs in O(n) time. Selection sort remains O(n^2), and merge sort remains O(n log n). Bubble sort is O(n^2) in the basic form unless an early-exit optimization is specified. Therefore, the best answer is insertion sort.