// function that sorts an array with
bubble sort algorithm
void bubbleSort( int a[], int size )
{
int hold; //
temporary location used to swap elements
// loop to control number of passes
for ( int pass = 1; pass
< size; pass++ )
// loop to control number of comparisons
per pass
for ( int j = 0; j < size - 1; j++ )
// swap elements if out of order
if ( a[ j ] > a[ j + 1 ] ) {
hold = a[ j ];
a[ j ] = a[ j + 1 ];
a[ j + 1 ] =
hold;
} // end if
} // end function bubbleSort