Multiple choice

Bubble sort's worst-case time complexity is

  1. O(n2)

  2. O(nlogn)

  3. O(logn)

  4. O(n)

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Bubble sort compares adjacent elements in nested loops, leading to O(n^2) in the worst case when the array is sorted in reverse order.