#include #include #define ARRAY_SIZE 100000 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; } } } } int main(void) { uint32_t *lArray = NULL; uint32_t lCnt = 0; uint32_t next = 1; lArray = (uint32_t*)malloc(sizeof(uint32_t) * ARRAY_SIZE); for(lCnt = 0; lCnt < ARRAY_SIZE; lCnt++) { next = next * 1103515245 + 12345; lArray[lCnt] = (uint32_t)(next / 4096) % ARRAY_SIZE; } bubbleSort(lArray, ARRAY_SIZE); free(lArray); return 0; }