Quicksort and copy
I'm trying to sort a dynamic array into a temporary dynamic array. So i can then print the sorted one without messing up the original array.
Because amxmodx uses quicksort (which is the best way) I'm also using quicksort. Now....i have as far as putting all the changed cells into the array, but the ones that don't move i'm just having a brain fart as to how i can tell if they've been moved or not. Can someone hint me towards how to tell? This is the code that i have. PHP Code:
Also...if i got anything wrong, please let me know. |
Re: Quicksort and copy
Dynamic arrays have their own sorting natives, so create a temp array, copy the default aray in it, use the sort native in the temp array.
|
Re: Quicksort and copy
That's what i ended up doing in the mean time till i figured this out.
I wanted to skip the first iteration of creating a temp array by sorting directly into the temp. |
Re: Quicksort and copy
Quote:
|
| All times are GMT -4. The time now is 05:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.