Skip to content

Commit 9a6001f

Browse files
committed
Fix linter errors: use list instead of List, remove unnecessary start in range
1 parent ace3204 commit 9a6001f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sorts/bubble_sort.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import Any, List
1+
from typing import Any
22

33
"""
44
Bubble Sort Algorithms
@@ -16,7 +16,7 @@
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

0 commit comments

Comments
 (0)