Question: Python 3 please modify bubble sort code. Modify this version of the bubble sort code so that it counts and returns both the number of

Python 3 please modify bubble sort code.
Modify this version of the bubble sort code so that it counts and returns both the number of comparisons and the number of swaps as one number. def bubble_sort_faster(values): count 0 for i in range(len (values) -1): for j in range(len (values) -1-i): countcount+ 1 if valuesj]values[j+1 temp values[j] values[j] - values[j+1] values [j+]temp return count
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
