What are the correct intermediate steps of the following data set - ProProfs Discuss

# What are the correct intermediate steps of the following data set when it is being sorted with the bubble sort: 15, 20, 10, 18?

Asked by RosyU, Last updated: Apr 15, 2024

A. 15,10,20,18 -- 15,10,18,20 -- 10,15,18,20

1

#### G. Cole

Find happiness in writing new things.

G. Cole, English Professor, PhD, Canterbury

We have a data set here to correctly or properly arrange using bubble sort, and also listing the intermediate steps. The set of number is 15, 20, 10, 18. To use a bubble sort, you have to arrange your number from the least of the highest, but it has to follow a process in such a way that only the numbers that are beside themselves can be switched, but no number can jump the other.

So, in the process of switching through numbers, you are aiming at have the numbers arranged in ascending order. Now, having these explanations in mind and having understood them, let us get back to our set of number, which is 15, 20, 10, 18. Now the smallest number there is 10.

So let us switch it by taking it leftward. We have 15, 10, 20, 18. Mind you, you can only switch two numbers at a time. Next, we will be switching 15 and 10, then we have 10, 15, 20, 18. And finally, we will have 10, 15, 18, 20. Thus, the correct intermediate steps would be 15, 10, 20, 18... 10, 15, 20, 18... 10, 15, 18, 20.

Its kind of my job to give answers

Anthony Paul Bonadio, Teacher, MCA, PhD, Toledo

The proper intermediate steps here would be 15,10,20,18 to 15,10,18,20 to 10,15,18,20, or answer A. Bubble sorting involves switching elements around if they are in the wrong order. It starts at the top and works its way down.

So, for this particular set of numbers, it’s probably one of the best things to use since the list is so short.
Bubble sorting is not used all that often because with longer lists, it takes forever to switch everything so that it is properly sorted from top to bottom.

Especially if one of the larger items is already at the bottom. Even the list of eight that acts as an example on Wikipedia takes about five minutes to be sorted out this way.

#### rosyU

RosyU

15,10,20,18 -- 15,10,18,20 -- 10,15,18,20