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

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

+ Answer
Request
Question menu
Vote up Vote down

4 Answers

John Adney

John Adney

John Adney
John Adney

Answered Dec 04, 2017

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

upvote 1 downvote
Reply 

G. Cole

G. Cole

Find happiness in writing new things.

G. Cole
G. Cole, English Professor, PhD, Canterbury

Answered Sep 25, 2020

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.

upvote downvote
Reply 

Anthony Paul Bonadio

Anthony Paul Bonadio

Its kind of my job to give answers

Anthony Paul Bonadio
Anthony Paul Bonadio, Teacher, MCA, PhD, Toledo

Answered Jan 03, 2019

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.

upvote downvote
Reply 

rosyU

rosyU

rosyU
RosyU

Answered Sep 10, 2017

15,10,20,18 -- 15,10,18,20 -- 10,15,18,20
upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.