The best case complexity of Insertion Sort occurs when the input is already sorted. In this case, the algorithm only needs to make one pass through the data, resulting in a time complexity of \(O(n)\). In the worst case (when the data is sorted in reverse order), the time complexity is \(O(n^2)\).
Was this answer helpful?
0
0
Top AP PGECET Computer Science & Information Technology Questions