What are the correct intermediate steps of the following data set - ProProfs Discuss
Topics
Products
Follow Us:

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



A. 15,10,20,18 -- 15,10,18,20 -- 10,15,18,20
B. 10, 20,15,18 -- 10,15,20,18 -- 10,15,18,20
C. 15,20,10,18 -- 15,10,20,18 -- 10,15,20,18 -- 10,15,18,20
D. 15,18,10,20 -- 10,18,15,20 -- 10,15,18,20 -- 10,15,18,20

This question is part of Bubble Sort Quiz
Asked by RosyU, Last updated: Aug 01, 2020

+ Answer
Request

3 Answers

John Adney

John Adney

Answered Dec 04, 2017

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

1
 

Anthony Paul Bonadio

Its kind of my job to give answers

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.

 

rosyU

RosyU

Answered Sep 10, 2017

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

Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer
Search for Google images
Select a recommended image
Upload from your computer

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