URL
https://opencores.org/ocsvn/theia_gpu/theia_gpu/trunk
Subversion Repositories theia_gpu
[/] [theia_gpu/] [branches/] [beta_2.0/] [regressions/] [single_core/] [test_bubble_sort.vpx] - Rev 218
Compare with Previous | Blame | View Log
// void bubbleSort(int numbers[], int array_size)
// {
// int i, j, temp;
// for (i = (array_size - 1); i > 0; i--)
// {
// for (j = 1; j <= i; j++)
// {
// if (numbers[j-1] > numbers[j])
// {
// temp = numbers[j-1];
// numbers[j-1] = numbers[j];
// numbers[j] = temp;
// }
// }
// }
// }
#define ARRAY_SIZE 10
function main()
{
vector array[ ARRAY_SIZE ];
array[ 0 ] = 6;
array[ 1 ] = 3;
array[ 2 ] = 1;
array[ 3 ] = 5;
array[ 4 ] = 4;
array[ 5 ] = 2;
array[ 6 ] = 8;
array[ 7 ] = 0;
array[ 8 ] = 9;
array[ 9 ] = 7;
}