Skip to content

Commit 525d161

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c7ea86e commit 525d161

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Diff for: sorts/bubble_sort.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -111,16 +111,18 @@ def bubble_sort_recursive(collection: list[Any]) -> list[Any]:
111111
doctest.testmod()
112112

113113
user_input = input("Enter numbers separated by a comma:").strip()
114-
unsorted = [int(item) if isinstance(item, int) else float(item)
115-
for item in user_input.split(",")]
114+
unsorted = [
115+
int(item) if isinstance(item, int) else float(item)
116+
for item in user_input.split(",")
117+
]
116118

117119
num_runs = 1000
118-
timer_iterative = timeit('bubble_sort_iterative(unsorted[:])',
119-
globals=globals(),
120-
number=num_runs)
121-
timer_recursive = timeit('bubble_sort_recursive(unsorted[:])',
122-
globals=globals(),
123-
number=num_runs)
120+
timer_iterative = timeit(
121+
"bubble_sort_iterative(unsorted[:])", globals=globals(), number=num_runs
122+
)
123+
timer_recursive = timeit(
124+
"bubble_sort_recursive(unsorted[:])", globals=globals(), number=num_runs
125+
)
124126

125127
print("\nIterative bubble sort:")
126128
print(*bubble_sort_iterative(unsorted), sep=",")

0 commit comments

Comments
 (0)