Saturday, April 14, 2012

Simple Bubble sort function in C Language Program

 void bubblesort(int array[],int size)  
 {  
 int tmp ,i,j;  
 for(i = 0;i  
 for(j=0;j < size;j++)  
 if(array[i] < array[j])  
 {  
 tmp = array[i];  
 array[i] = array[j];  
 array[j] = tmp;  
 }  
 }  

1 comment:

  1. There is printing error in line 3. Please check that.
    View this : Selection sort program in c

    ReplyDelete