File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -111,16 +111,18 @@ def bubble_sort_recursive(collection: list[Any]) -> list[Any]:
111
111
doctest .testmod ()
112
112
113
113
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
+ ]
116
118
117
119
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
+ )
124
126
125
127
print ("\n Iterative bubble sort:" )
126
128
print (* bubble_sort_iterative (unsorted ), sep = "," )
You can’t perform that action at this time.
0 commit comments