Ask your own question, for FREE!
Mathematics 13 Online
OpenStudy (amorfide):

When doing Bubble Sort, Do I stop when only one number is left, or do I do another pass going through the set of numbers so that no swaps occur?

OpenStudy (anonymous):

what grade is this?

OpenStudy (amorfide):

A level Further Mathematics. Decision 1 is the unit.

OpenStudy (anonymous):

When the end of the array is reached, the bubble sort algorithm will returns to element one and starts the process all over again. So, when will the bubble sort algorithm stop? The bubble sort algorithm knows when it’s finish when there are no more “swaps”. This can be tracked by the bubble sort algorithm through a so called swap flag.

OpenStudy (amorfide):

so I stop once a pass has no swaps, thank you <3

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!