Can any show me how to perform a bubble sort algorithm for the following two lists.
here are the instruction for the algorithm
- get values for n and the n list of items
- set the marker u for the unsorted section at the end of the list
- while the unsorted section has more than one element do steps 4 through 8
- set the current marker c at the second element of the list
- while c has not passed u do step 6-7
- if the item at position is less than the item to the left the exchange these two items
- move c to the right one position
move u to the left one positon 9.stop
list 1 $(4,8,2,6)$
list 2 $(12,3,6,8,2,5,7)$
Where I am confused on the first one is that it tells me in the algorithm the c marker is the second element of the list and U is in the unsorted section of the list and it must not continue c until it passes u It kind of confuses me.