in

my Sorting Algorithm Is Too Fast Can Someone Help

my Sorting Algorithm Is Too Fast Can Someone Help

void smartSort(int* arr, int size, int fullSize) !

//printf(“run”);

arrayPrintNewLine(arr, size, fullSize);

if (size <= 3) 1

while (isSorted(arr, size)) E

randomSwap(arr, size);

return;

partone = size / 2;

partTwo

= size / 2;

else

partone = size / 2 + 1;

partTwo = size / 2;

smartSort(arr, partone, fullSize);

smartSort(arr + partone, partTwo, fullSize);

while (isSorted(arr, size)) &

int* randIndexOne = arr+rand % partne;

int* randIndexTwo = arr+(rand % partTwo+partone;

if (*(randIndexTwo) > *(randIndexOne)) €

ptrSwap(randIndexOne, randIndexTwo);

else

int randone = rand % size;

int randMOne = randOne + (rand) % (size-randOne))+1

if (*(arr + randOne) > *(arr + randMOne)) {

ptrSwap(arr + randOne), (arr + randMOne)) ;

3

return:

What do you think?

Written by codeitbro

Codeitbro.in is a hub of funny coding and programming memes. Explore memes on various topics such as cybersecurity, Linux, Software Testing, and many others.

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings