Which of the following is the Best Case Time Complexity of the Bubble Sort algorithm?

  • AO(n)
  • BO(n²)
  • CO²(n²)
  • DNone of these
Show answerHide answer

Correct answer A

Best case occurs when the array is already sorted. With an optimized Bubble Sort (using a swap flag), no swaps are needed. The algorithm makes only one pass, resulting in O(n) time. Key facts: Average case → O(n²) Worst case → O(n²) Comparisons in best case → (n − 1) Swaps → 0.