mdd/gpu/ArrayUtils.cpp
void sortIndexes(long* array, long n)
{
	for (long i = 0; i < n - 1; i++)
	{
		for (long j = 0; j < n - i - 1; j++)
		{
			if (array[j] > array[j + 1])
			{
				int tmp = array[j];
				array[j] = array[j + 1];
				array[j + 1] = tmp;
			}
		}
	}
}
/*
* Sort array in asc order
* Input: array and it's length
* Output: sorted array
*/
Sort array in asc order
Input: array and it's length
Output: sorted array
Sort array in asc order Input : array and it ' s length Output : sorted array
void sortIndexes(long* array, long n)
{
	for (long i = 0; i < n - 1; i++)
	{
		for (long j = 0; j < n - i - 1; j++)
		{
			if (array[j] > array[j + 1])
			{
				int tmp = array[j];
				array[j] = array[j + 1];
				array[j + 1] = tmp;
			}
		}
	}
}
void sortIndexes ( long * array , long n ) { for ( long i = 0 ; i < n - 1 ; i ++ ) { for ( long j = 0 ; j < n - i - 1 ; j ++ ) { if ( array [ j ] > array [ j + 1 ] ) { int tmp = array [ j ] ; array [ j ] = array [ j + 1 ] ; array [ j + 1 ] = tmp ; } } } }
Sort array in asc order
Input: array and it's length
Output: sorted array
Sort array in asc order Input : array and it ' s length Output : sorted array