Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sorts/bubble_sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
def bubble_sort_iterative(collection: list[Any]) -> list[Any]:
"""Pure implementation of bubble sort algorithm in Python

Sort a list of numbers in ascending order using the bubble sort algorithm.
Bubble sort repeatedly steps through the list, compares adjacent elements,
and swaps them if they are in the wrong order. This process continues until
the list is fully sorted.

:param collection: some mutable ordered collection with heterogeneous
comparable items inside
:return: the same collection ordered by ascending
Expand Down