File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1- from typing import Any , List
1+ from typing import Any
22
33"""
44Bubble Sort Algorithms
1616"""
1717
1818
19- def bubble_sort_iterative (collection : List [Any ]) -> List [Any ]:
19+ def bubble_sort_iterative (collection : list [Any ]) -> list [Any ]:
2020 """
2121 Bubble Sort (Iterative)
2222
@@ -32,7 +32,7 @@ def bubble_sort_iterative(collection: List[Any]) -> List[Any]:
3232
3333 for i in range (n ):
3434 swapped = False
35- for j in range (0 , n - i - 1 ):
35+ for j in range (n - i - 1 ): # removed unnecessary start=0
3636 if collection [j ] > collection [j + 1 ]:
3737 collection [j ], collection [j + 1 ] = collection [j + 1 ], collection [j ]
3838 swapped = True
@@ -43,7 +43,7 @@ def bubble_sort_iterative(collection: List[Any]) -> List[Any]:
4343 return collection
4444
4545
46- def bubble_sort_optimized (collection : List [Any ]) -> List [Any ]:
46+ def bubble_sort_optimized (collection : list [Any ]) -> list [Any ]:
4747 """
4848 Optimized Bubble Sort
4949
You can’t perform that action at this time.
0 commit comments