Sorting Arrays - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html) +--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html) +--- Thread: Sorting Arrays (/thread-6749.html) |
Sorting Arrays - Agamemnus - 06-03-2005 Code: DECLARE SUB qsort.byte.lowstart (array1() AS LONGINT, a.max%) Sorting Arrays - DrV - 06-04-2005 Aaaahhh!1 Run away! jk, good to see you and your algorithms again. Sorting Arrays - Anonymous - 06-04-2005 takes like 25 seconds on my 500 mhz Sorting Arrays - Agamemnus - 06-05-2005 which one? Thank you, DrV. I'll be adding a function to search sorted arrays in log(n) time tomorrow, hopefully. Sorting Arrays - Agamemnus - 06-05-2005 Ok.... what I did uses 1 byte not 7. Now I used the 64 bit unsigned integers. (editing the post now) The speed is still 1 second to do the sort as opposed to 7.5 with that first program in powerbasic. Sorting Arrays - Anonymous - 06-05-2005 unless you have a 64-bit processor, i dont think youll get a speed increase with longint... try making them all integers instead (32-bit) Sorting Arrays - Agamemnus - 06-05-2005 If you read the first post, he said 7 bytes. That's 56 bits. You can't use a single 32 bit integer for that. Sorting Arrays - wallace - 06-07-2005 Time and time again a Radix sort will beat a Quicksort when it comes to speed, they usually use LinkedLists, but could be done in FB with simple arrays. I plan to implement one when sorting sprites in the Inspiration Engine. Sorting Arrays - dumbledore - 06-07-2005 maybe, but crt's qsort was written in c with an optimizing compiler, it'll probably beat you every time ;P Sorting Arrays - DrV - 06-07-2005 Actually, I think MS's CRT is mostly written in x86 ASM... the sources are distributed with some versions of Visual Studio. (Of course, you can't use them yourself, but they're there for reference.) |