Bubble Sort Practice

What would the following array look like after one iteration of bubble sort ?

A = [ 12 , 4 , 8 , 2 , 15 , 13 , 1 ] A =[12,4,8,2,15,13,1]

A = [4, 8,2,12,15,13,1] A = [4,8,2,12,13,1,15] A = [1,2,4,8,12,13,15] A = [2,12,4,8,1,15,13]

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Karleigh Moore
Mar 24, 2016

The elements being compared are bolded.

A = [ 12 , 4 ,8,2,15,13,1]

A = [4, 12 , 8 ,2,15,13,1]

A = [4, 8, 12 , 2 ,15,13,1]

A = [4, 8,2, 12 , 15 ,13,1]

A = [4, 8,2,12, 15 , 13 ,1]

A = [4, 8,2,12,13, 15 , 1 ]

A = [4, 8,2,12,13,1,15]

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...