Skip to content

Commit 8bfad97

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 152ea4b commit 8bfad97

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

sorts/bubble_sort.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
def bubble_sort_iterative(collection: list[Any]) -> list[Any]:
55
"""Pure implementation of bubble sort algorithm in Python.
6-
Bubble sort repeatedly steps through the list, compares adjacent
7-
elements, and swaps them if they are in the wrong order.
8-
This process is repeated until the list is sorted.
9-
6+
Bubble sort repeatedly steps through the list, compares adjacent
7+
elements, and swaps them if they are in the wrong order.
8+
This process is repeated until the list is sorted.
9+
1010
Time Complexity:
1111
Worst Case: O(n^2)
1212
Average Case: O(n^2)
13-
Best Case: O(n) (When the list is already sorted and
13+
Best Case: O(n) (When the list is already sorted and
1414
optimized with early stopping)
1515
1616
Space Complexity:
@@ -77,7 +77,7 @@ def bubble_sort_recursive(collection: list[Any]) -> list[Any]:
7777
Time Complexity:
7878
Worst Case: O(n^2)
7979
Average Case: O(n^2)
80-
Best Case: O(n^2) (no early stopping
80+
Best Case: O(n^2) (no early stopping
8181
optimization like iterative version)
8282
8383
Space Complexity:

0 commit comments

Comments
 (0)