Leaderboard[kills]
#9

pawn Код:
stock quickSort(array[], left, right)
{
    /*new
        array[] = { -541, 54, 689, 12, 3, 0, 3, 55, 66, -541, 5468484, -564, 1554, 1656 }
    ;
    quickSort(array, 0, sizeof(array) - 1);
       
    for(new i; i != sizeof(array); ++i)
    {
        printf("%d", array[i]);
    }*/


    new templeft = left, tempright = right, pivot = array[(left + right) / 2], tempvar;
    while(templeft <= tempright)
    {
        while(array[templeft] < pivot) templeft ++;
        while(array[tempright] > pivot) tempright --;
        if(templeft <= tempright)
        {
            tempvar = array[templeft], array[templeft] = array[tempright], array[tempright] = tempvar;
            templeft ++, tempright --;
        }
    }
    if(left < tempright) quickSort(array, left, tempright);
    if(templeft < right) quickSort(array, templeft, right);
}
Reply


Messages In This Thread
Leaderboard[kills] - by DavidBilla - 28.05.2014, 09:33
Re: Leaderboard[kills] - by DavidBilla - 28.05.2014, 17:18
Re: Leaderboard[kills] - by DavidBilla - 29.05.2014, 09:50
Re: Leaderboard[kills] - by Matess - 29.05.2014, 10:10
Re: Leaderboard[kills] - by DavidBilla - 29.05.2014, 17:15
Re: Leaderboard[kills] - by JFF - 29.05.2014, 19:52
Re: Leaderboard[kills] - by R0 - 29.05.2014, 20:09
Re: Leaderboard[kills] - by FeniX70 - 30.03.2015, 02:10
Re: Leaderboard[kills] - by SickAttack - 30.03.2015, 02:15

Forum Jump:


Users browsing this thread: 7 Guest(s)