Bubble sort algorithm sorts n data items using

Bubble sort algorithm sorts n data items using Correct Answer O(n2) comparison

Bubble sort is a simple sorting algorithm. This sorting algorithm is comparison based algorithm in which each pair of adjacent elements is compared and the elements are swapped if they are not in order. The average & average case complexity of bubble sort is O(n2).

Related Questions

Why is insertion sort preferred over other sorting algorithms (like selection sort, bubble sort etc.) for Tim sort implementation?
Why is insertion sort preferred over other sorting algorithms (like selection sort, bubble sort etc.) for introsort implementation?