12-25-2005, 05:55 AM
Quote:are we talking qb or fb here?We've been talking QB up to now, but if you want to run some sort testing and timing in FB, that'll be fine.
*****
radix vs quiksort
|
12-25-2005, 05:55 AM
Quote:are we talking qb or fb here?We've been talking QB up to now, but if you want to run some sort testing and timing in FB, that'll be fine. *****
12-25-2005, 07:46 AM
i've been testing in FB, comparing against the Ethan Winer QuickSort(), and the C Runtime qsort()
it seems like it would be slow. on my 5000 string data with the Winer QuickSort 48,152 string comparisions are performed, with the Moneo Selection Sort 12,497,500 string comparisons occur.
12-26-2005, 12:18 AM
Quote:i've been testing in FB, comparing against the Ethan Winer QuickSort(), and the C Runtime qsort()The timing criteria used by the original SortDemo program is based on the number of times that elements are swapped, not on the number compared. I used the same criteria in the test program that I wrote. Maybe that has something to do with it. As you probably already know, the beginning random order of the elements in the array must be exactly the same for each sort algorithm applied. This can be done by generating the random numbers each time WITHOUT having done a RANDOMIZE TIMER statement. If your program is not too long, why don't you post it so I can try it. *****
12-26-2005, 07:46 AM
i tested string compares as i thought this would be the most processor intensive part, in an ideal world i would just be swapping pointers to strings so to me the number of swaps was not as important
ok, stripped out some of the the fluff and here it is. Code: #include "crt.bi"
12-26-2005, 08:12 AM
Yetifoot,
Nice piece of code. I'll try to figure it out and do some testing. ***** EDIT: Dec 26, 2005, 1:00 pm. First of all, your program issued compile errors. I still have FB version 13, but that shouldn't matter. In several places you used an ampersand (&) instead of a plus sign (+), and on PRINT lines you also used ampersand which I had to replace with a semicolon. When it finally compiled and ran, it printed the following results which I don't really understand. Code: *** For Winer's Quick Sort Maybe you did some last minute enhancements before posting the code. Trying to get your code to work has steered me away from the original issue, that is, comparing the timing of sort algorithms. If you would be so kind, please post a workable version with understandable output. *****
12-28-2005, 02:35 AM
Quote:First of all, your program issued compile errors. I still have FB version 13, but that shouldn't matter. In several places you used an ampersand (&) instead of a plus sign (+), and on PRINT lines you also used ampersand which I had to replace with a semicolon.This is in fact a new feature of FB version 0.15 (it's borrowed from VB) - & is string concatenation with automatic conversion to string of any other datatype.
12-28-2005, 03:01 AM
apologies if you had trouble with the code, it wasn't really intended for release, it was my private test. I have now updated the test code in my previous post. The program now runs both tests (Using Randomize 1 to force the same set of data) the ampersand character has now gone replaced with semi-colon (changing to a + causes type mismatch on 0.15) also i have used format to print the time without e form.
12-28-2005, 05:52 AM
Quote:apologies if you had trouble with the code, it wasn't really intended for release, it was my private test. I have now updated the test code in my previous post. The program now runs both tests (Using Randomize 1 to force the same set of data) the ampersand character has now gone replaced with semi-colon (changing to a + causes type mismatch on 0.15) also i have used format to print the time without e form.Hey, no problem. I got an error compiling the new version. I don't have the include file called vbcompat.bi. Does the program really need it? What's it for? If you need it, where can I get it, and into which subdirectory of Freebasic do I put it? *****
12-28-2005, 06:04 AM
Quote:...... DrV, Would you kindly provide me with a link where I can download FB version 0.15 for Windows, including the latest version of the FBIDE. Thanks. *****
12-28-2005, 06:36 AM
I'm not an FBIDE user myself, but apparently there hasn't been a packaged release with 0.15 yet; luckily, it's relatively simple to get the two separately and configure FBIDE to use the new fbc release.
Get the latest FBIDE installer from here: http://prdownloads.sourceforge.net/fbide...e?download (You can see all the releases here: http://sourceforge.net/project/showfiles...5923#files ) Get fbc 0.15 for Windows here: http://prdownloads.sourceforge.net/fbc/F...e?download Run the fbc installer first, then run the FBIDE installer and specify the path to fbc.exe (where you installed fbc 0.15) when prompted. |
« Next Oldest | Next Newest »
|