Time Complexity of Insertion Sort having 'n' elements in the list in the worst case is:
Time Complexity of Insertion Sort having 'n' elements in the list in the worst case is:
Solution
✅ Correct Option: 3
In the worst case the list is in reverse order, so each new element must be compared with and shifted past all the elements already sorted before it.
The -th element needs shifts, so the total work is:
Option 1: is the best case, when the list is already sorted and each element needs only one comparison.
Insertion sort is in both the average and the worst case.
Related questions:
2026: 26 May Shift 1
2026: 19 May Shift 1
2026: 29 May Shift 1
2026: 19 May Shift 1