Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

buble sort c


void bubbleSort(int arr[], int n){
   int i, j;
   for (i = 0; i < n-1; i++)      
  
       for (j = 0; j < n-i-1; j++) 
           if (arr[j] > arr[j+1])
              swap(&arr[j], &arr[j+1]);
}
 
PREVIOUS NEXT
Tagged: #buble #sort
ADD COMMENT
Topic
Name
8+3 =