Bubble Sort Bubble Sort takes values and floats to the correct position function BUBBLESORT(A) Set n to be length of A Set swapped True while swapped do Set swapped False for i 1, in, it+ do if A[i 1...

Bubble Sort Bubble Sort takes values and floats to the correct position function BUBBLESORT(A) Set n to be length of A Set swapped True while swapped do Set swapped False for i 1, in, it+ do if A[i 1 A[ then Swap A[i 1] and A[i] Set swapped-True end if end for end while end function main.py Load default template... def BubbleSort (A): #Complete Implementation 2 return 5 #You may implement helper functions 7 #Test Area Do Not make changes below this line. 8 import random 9 print ("Bubble Sort Test Question") 10 x int (input ( "Enter Seed for Testing: \n") ) 11 random. seed (x) 12 test_size int (input ("Enter Test Size: \n") ) 13 L [random.randint (0,50) for x in range (0, test_size)] 14 15 print ("Bubble Sorting List" ) 16 print ("Initial List: ",L) 17 BubbleSort ( L) 18 print("Final List:",L) 1: Compare output Output differs. See highlights below. Special character legend 10 Input 3 Bubble Sort Test Question Enter Seed for Testing: Enter Test Size: Your output Bubble Sorting List Initial List: [36, 2, 27] Final List: [36, 2, 27] Bubble Sort Test Question Enter Seed for Testing: Enter Test Size: Bubble Sorting List Initial List: [36, 2, 27] Expected output Compare 36 to 24 Compare 36 to 274 Compare 2 to 274 Compare 27 to 36 Final List: [2, 27, 36] Output differs. See highlights below. Special character legend 9 Input Bubble Sort Test Question Enter Seed for Testing: Enter Test Size: Your output Bubble Sorting List Initial List: [29, 39, 23, 17, 8] Final List: [29, 39, 23, 17, 81 Bubble Sort Test Question Enter Seed for Testing: Enter Test Size: Bubble Sorting List Initial List: [29, 39, 23, 17, 81 Compare 29 to 39 Compare 39 to 23e Compare 39 to 17e Compare 39 to 8e Compare 29 to 23e Compare 29 to 17e Compare 29 to 8e Compare 29 to 39 Compare 23 to 17 Expected output Compare 23 to 8 Compare 23 to 29e Compare 29 to 39e Compare 17 to 8e Compare 17 to 23e Compare 23 to 29e Compare 29 to 39e Compare 8 to 17e Compare 17 to 23e Compare 23 to 29e Compare 29 to 39e Final List: [8, 17, 23, 29, 39] 3: Compare output Output differs. See highlights below. Special character legend 28 Input Bubble Sort Test Question Enter Seed for Testing: Enter Test Size: Your output Bubble Sorting List Initial List: [7, 47, 8, 34, 38, 45] 38, 45 Final List: [7, 47, 8, 34, Bubble Sort Test Question Enter Seed for Testing: Enter Test Size: Bubble Sorting List Initial List: [7, 47, 8, 34, 38, 45] to 47 Compare 7 Compare 47 to 8 Compare 47 to 34 Compare 47 to 38 Expected output Compare 47 to 45e Compare 7 to 8e Compare 8 to 34 Compare 34 to 38 Compare 38 to 45 Compare 45 to 47 Final List: [7, 8, 34, 38, 45, 471 LO st C 4: Compare output Output differs. See highlights below. Special character legend 32 Input Bubble Sort Test Question Enter Seed for Testing: Enter Test Size: Your output Bubble sorting List Initial List: [4, 13, 9, 19, 44, 15, 31, 1, 46] 44, 15, 31, 1, 46 Final List: [4, 13, 9, 19 Bubble Sort Test Question Enter Seed for Testing: Enter Test Size: Bubble Sorting List Initial List: [4, 13, 9, 19, 44, 15, 31, 1, 46 Compare 4 to 13 Compare 13 to 9 Compare 13 to 19e Compare 19 to 444 Compare 44 to 15e Compare 44 to 31e Compare 44 to 1e Compare 44 to 46e Compare 4 to 9 Compare 9 to 13 Compare 13 to 19e Compare 19 to 15t Compare 19 to 31e Compare 31 to 1 Compare 31 to 44 Compare 44 to 464 Compare 4 to 9 Compare 9 to 13e Compare 13 to 15e Compare 15 to 19e Compare 19 to 1e Compare 19 to 31e Compare 31 to 44 Compare 44 to 46e Compare 4 to 9 Compare 9 to 13e Compare 13 to 15 Compare 15 to 1 Compare 15 to 19e Compare 19 to 31e Expected output Compare 31 to 44 Compare 44 to 46 Compare 4 to 9e Compare 9 to 13e Compare 13 to 1e Compare 13 to 15 Compare 15 to 19e Compare 19 to 31e Compare 31 to 44 Compare 44 to 46 Compare 4 to 9 Compare 9 to 1e Compare 9 to 13+ Compare 13 to 15e Compare 15 to 19e Compare 19 to 31 Compare 31 to 44 Compare 44 to 46e Compare 4 to 1e Compare 4 to 9 Compare 9 to 13e Compare 13 to 15e Compare 15 to 19e Compare 19 to 31e Compare 31 to 44 Compare 44 to 46e Compare 1 to 4 Compare 4 to 9 Compare 9 to 13 Compare 13 to 15e Compare 15 to 19d Compare 19 to 314 Compare 31 to 44 Compare 44 to 46e Final List: [1, 4, 9, 13, 15, 19, 31, 44, 46 5: Compare output Special character legend Output differs. See highlights below. 2 Input 4 Bubble Sort Test Question Enter Seed for Testing Enter Test Size: Your output Bubble Sorting List Initial List: [3, 5, 5, 231 Final List: [3, 5, 5, 23] Bubble Sort Test Question Enter Seed for Testing: Enter Test Size: Bubble Sorting List Initial List: [3, 5, 5, 23 Expected output Compare 3 to 5e Compare 5 to 5 Compare 5 to 23+ Final List: [3, 5, 5, 23] stt
May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here