Which of the following sorting algorithms has a worst-case time complexity of O(n^2)?
16 views
- Quick sort
- Merge sort
- Insertion sort (Correct Answer)
- Radix sort
Explanation
Answer: c) Insertion sort
Explanation: Insertion sort is a simple sorting algorithm that iterates through an array and inserts each element in its proper position. Its worst-case time complexity is O(n^2), which makes it inefficient for large data sets.