Joined: Sun Sep 07, 2008 2:09 am Posts: 2 Has thanked: 0 time Have thanks: 0 time
Well I'm kinda new to programming and since i didn't see this sort on this site I thought that I'd post mine. Just made this last night just to see if I could. If you see any errors please point them out.
do { d = 0; for(int b = 0; b < 9; b++) { if(a[b] > a[b+1]) { c = a[b]; a[b] = a[b+1]; a[b+1] = c; d++; } } }while(d);
return a; }
This algorithm is one of the simplest and easiest to understand but it is very inefficient so I wouldn't use it for anything serious. This sorts out 10 integers in an array and puts them from lowest to highest order.
msi_333
Question subject: Re: C++ Bubble Sort
Posted: Sun Sep 07, 2008 7:57 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2103 Location: Earth Has thanked: 39 time Have thanks: 56 time
Thanks "Shimano" for your post .
About my self i made the bubble sort before by my self but i don;t know where the code gone . thanks and keep sharing your work , i am sure it will be helpful to someone .
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )