• Post Reply Bookmark Topic Watch Topic
  • New Topic

Having trouble with bubble sort list wise (selection sort)  RSS feed

 
Aron Silvester
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The code below is for a bubble sort list wise (selection sort). I've gone over it multiple times but I don't know why it doesn't sort the numbers from ascending order. Below is the code and its output. What do you think is causing this? This by the way is from a youtube video.

BUBBLE SORT CODE LIST WISE (SELECTION SORT):


OUTPUT:
run:
Array before sorting:
1 6 5 8 9 4 3 2
*************************************
Array after sorting with bubble sort
1 6 5 8 9 4 3 2




 
Aron Silvester
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aron Silvester wrote:The code below is for a bubble sort list wise (selection sort). I've gone over it multiple times but I don't know why it doesn't sort the numbers from ascending order. Below is the code and its output. What do you think is causing this? This by the way is from a youtube video.

BUBBLE SORT CODE LIST WISE (SELECTION SORT):


OUTPUT:
run:
Array before sorting:
1 6 5 8 9 4 3 2
*************************************
Array after sorting with bubble sort
1 6 5 8 9 4 3 2







Never mind I figured it out. Thanks.
 
Campbell Ritchie
Marshal
Posts: 55793
164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what was your solution?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!