Skip to content

Commit f11c5ec

Browse files
docs: expand bubble sort explanation
1 parent 8934bab commit f11c5ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sorts/bubble_sort.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
def bubble_sort_iterative(collection: list[Any]) -> list[Any]:
55
"""Pure implementation of bubble sort algorithm in Python
66
7+
Sort a list of numbers in ascending order using the bubble sort algorithm.
8+
Bubble sort repeatedly steps through the list, compares adjacent elements,
9+
and swaps them if they are in the wrong order. This process continues until
10+
the list is fully sorted.
11+
712
:param collection: some mutable ordered collection with heterogeneous
813
comparable items inside
914
:return: the same collection ordered by ascending

0 commit comments

Comments
 (0)