Question: Exercise 1 1 referfo another algorithm, called bubble sort, which sorts an n - element list. Bubble sort makes multiple passes through the list from
Exercise referfo another algorithm, called bubble sort, which sorts an nelement list. Bubble sort makes multiple passes through the list from front to back, each time exchanging pairs of entries that are out of order. Here is a pseudocode version:
Get values for and the list items
Set the marker for the unsorted section at the end of the list
While the unsorted section has more than one element, do Steps through
Set the current element marker at the second element of the list
While Chas not passed do Steps and
If the item at position is less than the item to its left, then exchange these two items
Move to the right one position
Move U left one position
Stop
For each of the following lists, perform a bubble sort, and show the list after each exchange. Compare the number of exchanges done here and in the Practice Problem at the end of Section
a
type your answer..
type your answer..
type your answer...
type your answer... type your answer.. type your answer..
type your answer...
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
