lemming Posted May 29, 2010 Report Share Posted May 29, 2010 Here's not one, but two sort algorithms implemented in MEP. The first is the classic Bubble Sort algorithm, while the second is Gnome Sort, described as "the simplest sort algorithm". These are "pure" macros - no external programs, scripts or libraries are used. I didn't even use dynamic variables! (i.e. Run Macro in Variable). However, they only work with MEP, because they both need arrays. These scripts' performance are better than my old ME3 Bubble Sort script, but they're still slow - many orders of magnitude slower than the built-in sorting functions available in other programming languages and script languages. UPDATE 1: I cleaned up the code a bit and added more comments. Thanks, Paul. Pls delete any ver 0.8 files you have, and download the latest. UPDATE 2: Tweaked the code for better performance, updated benchmarks and added an installation guide. Pls download the latest files below and delete old versions. Benchmarks on an old machine running Win XP (P4 3GHz Northwood, about 5 years old): Bubble Sort 100 elements = about 1.0 sec 250 elements = about 5.7 sec 500 elements = about 24.7 sec Gnome Sort 100 elements = about 1.2 sec 250 elements = about 6.6 sec 500 elements = about 30.3 sec You can easily conduct your own benchmarking because I've included code for reporting the start and end time. Comments are appreciated. Regards, Lemming Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.