Unsorted
Comparing
Swapping
Overwriting from Memory
Sorted
Bubble Sort is a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order.The pass through the list is repeated until the list is sorted. The algorithm, which is a comparison sort, is named for the way smaller or larger elements "bubble" to the top of the list. Although the algorithm is simple, it is too slow and impractical for most problems
Know MoreWorst-Case Time Complexity O(n^2)
Average Time Complexity O(n^2)
Besst-Case Time Complexity O(n)
Worst-Case Space Complexity O(1)