Extra CreditOptional. Not required for any homework drop.
Somebody told me there is more than one way to sort a list. Showme a different one from the one you already showed me, and tellme honestly which is better.Write your requirements list before you write any code. Input, calculate, output, and anything you had to decide for yourself.
After pass 1: 17 42 8 55 31 93After pass 2: 17 8 42 31 55 93After pass 3: 8 17 31 42 55 93After pass 4: 8 17 31 42 55 93Comparisons: 20, passes: 4 (selection sort: 15 every time)
The same list again, already sorted:After pass 1: 8 17 31 42 55 93Comparisons: 5, passes: 1 (selection sort: 15 every time)This is the deck's array from Activity 2.12. Bubble sort does more work on it than selection sort, and far less on a sorted one.
Your requirements list and your program file, named cc-bubble-sort.