Bubble Sort Algorithm is the most Simple and most Popular Sorting Algorithm. In this article you will find the Bubble Sort Algorithm implemented in Java.
Image Source: Medium
Worst and Average Case Time Complexity (Worst case occurs when array is completely in reverse order): O(n*n).
Best Case Time Complexity (Best case occurs when given array is already sorted ): O(n).
Auxiliary Space: O(1)
Boundary Cases: Bubble sort takes minimum time (Order of n) when elements are already sorted.