[Help] RyDeR's Quicksort Algorithm
#1

Hello, there's a way to make the Quicksort algorithm by RyDeR`in descending order?

https://forum.sa-mp.com/showpost.php...postcount=1737
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
1) RyDer didn't create the algorithm. It is by Donald Knuth (I believe).

2) Slice created a whole include for this, called md-sort. It does ascending, descending, strings, and more.
Forgive me for the mistake, and thanks for the info, I will look.
Reply
#3

Hello, I came back here to avoid creating another topic, so I'm using MD-Sort now, but I have a problem.

PHP код:
    for(new 0500i++)
    {
       
SortScore[i][1] = ScoreID[i]; 
    }

    
SortDeepArray(SortScore0, .order SORT_DESC); // This part

    
for(new 010i++)
    {
        
printf("%i"SortScore[i][1]);
    } 
When I put it to sort (Where checked above), it returns "0" on all the cells of the array, but when removing this, it normally returns the values ​​of each cell, I checked using printf in the above code.
Reply
#4

PHP код:
enum
    tempArrayEnum 
{
    
    
tempArraySort
};
new
    
tempArray[24][tempArrayEnum] = {
    
    
95372233751
};
SortDeepArray(tempArraytempArraySort, .order SORT_DESC); 
95, 3, 7, 2, 233, 75, 1, 0, 0, ...

Will become;

0, 0, 0, ..., 1, 2, 3, 7, 75, 95, 233

Loop through the array after you deep sort it, "continue" if "tempArraySort" == 0, this will give you your desired result.
Reply
#5

Quote:
Originally Posted by d1git
Посмотреть сообщение
PHP код:
enum
    tempArrayEnum 
{
    
    
tempArraySort
};
new
    
tempArray[24][tempArrayEnum] = {
    
    
95372233751
};
SortDeepArray(tempArraytempArraySort, .order SORT_DESC); 
95, 3, 7, 2, 233, 75, 1, 0, 0, ...

Will become;

0, 0, 0, ..., 1, 2, 3, 7, 75, 95, 233

Loop through the array after you deep sort it, "continue" if "tempArraySort" == 0, this will give you your desired result.
It does not work, it just skips the entire LOOP because it's all zero.
For some reason, when I sort, the cells assume the value of "0", but when I remove the sort function and print the cells, it normally shows the values ​​imbuyed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)