+1 vote
73 views

I answered this as $O(n^2)$ considering the question asks for best worst case of all inplace sorting algorithms.

quetion ask best case for any inplace sorting algorithm . Bubble sort will take O(n).

O(n) is right

BEST CASE OF INSERTION SORT

The best case input is an array that is already sorted. In this case insertion sort has a linear running time (i.e., O(n)). During each iteration, the first remaining element of the input is only compared with the right-most element of the sorted subsection of the array.