Skip to main content
baggio10
Associate
November 24, 2003
Question

ST7 bubblesort

  • November 24, 2003
  • 2 replies
  • 692 views
Posted on November 24, 2003 at 08:22

ST7 bubblesort

This topic has been closed for replies.

2 replies

baggio10
baggio10Author
Associate
November 23, 2003
Posted on November 23, 2003 at 07:00

I'm at the beginning with st7 programmation and i'm looking for a program that implemented the bubblesort algorithm.

Thank you that help me

parveen
Associate II
November 24, 2003
Posted on November 24, 2003 at 08:22

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