What is the average case complexity of bubble sort?

Nam Phong

New member
What is the average case complexity of bubble sort?
A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n$^{2}$)
 
Answer: D
Explanation: Bubble sort works by starting from the first element and swapping the elements if required in each iteration even in the average case.
 

Tìm kiếm

Back
Top