2003-11-23 11:22 PM
2003-11-22 10:00 PM
I'm at the beginning with st7 programmation and i'm looking for a program that implemented the bubblesort algorithm.
Thank you that help me2003-11-23 11:22 PM
for(i=0;i
{ for(j=i+1;j { if(data[i]>data[j]) { temp=data[i]; data[i]=data[j]; data[j]=temp; } //if loop } //for j loop }//for i loop You can optimize the algorithm by exiting the loop if there is no swapping in a particular loop. Hope this helps Regards, PraveenG