xxxxxxxxxx
O(n²) in the average and worst cases
O(n) in the best case
xxxxxxxxxx
Bubble sort has a worst-case and average complexity of О(n2), where n is the number of items being sorted. Most practical sorting algorithms have substantially better worst-case or average complexity, often O(n log n).
xxxxxxxxxx
O(N^2)
// Generally when we talk about time complexity of an algorithm it means its
worse case complexity
-- N= size of an input