mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-29 18:06:45 +00:00
Initial Home page
commit
948071d531
7
Sorting-Algorithms.md
Normal file
7
Sorting-Algorithms.md
Normal file
@ -0,0 +1,7 @@
|
||||
## Bubble sort:
|
||||
|
||||

|
||||
|
||||
**Bubble sort**, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted. The algorithm, which is a comparison sort, is named for the way smaller elements "bubble" to the top of the list. Although the algorithm is simple, it is too slow and impractical for most problems even when compared to insertion sort. It can be practical if the input is usually in sorted order but may occasionally have some out-of-order elements nearly in position.<br>
|
||||
**read more at: [Wikipedia](https://en.wikipedia.org/wiki/Bubble_sort)**<br>
|
||||
**code: [Bubble sort](https://github.com/TheAlgorithms/Python/blob/master/sorts/bubble_sort.py)**
|
Loading…
x
Reference in New Issue
Block a user