advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   TIP BANK
Browse DevX
Partners & Affiliates
advertisement
advertisement
 

A Comparison of Sorting Algorithms

Methods for sorting have been intensively studied and optimized. Nevertheless, many poor algorithms (or poor versions of good algorithms) are still in circulation. VB2TheMax's friend David B. Ring have translated a variety of sorting routines into Visual Basic and compared their performance. The collection includes some of the faster algorithms known (e.g., QuickSort, RadixSort and Merge-Sort) and incorporates many optimizations known to increase speed and/or consistency. In this article he discusses and compares the various sorting methods, and provides code to use them in your own applications. 


ethods for sorting have been intensively studied and optimized.  Nevertheless, many poor algorithms (or poor versions of good algorithms) are still in circulation.  Recently, I have translated a variety of sorting routines into Visual Basic and compared their performance.  The collection includes some of the faster algorithms known (e.g., QuickSort, RadixSort and Merge-Sort) and incorporates many optimizations known to increase speed and/or consistency.  On an 800 mhz PowerBook running the VBA routines in Excel 2001, I observe sorting speeds as high as a million random strings or doubles per minute (Table 1).  I hope you will find the code for these sorts useful and interesting.

 

What makes a good sorting algorithm?  Speed is probably the top consideration, but other factors of interest include versatility in handling various data types, consistency of perform-ance, memory requirements, length and complexity of code, and the property of stability (preserving the original order of records that have equal keys).  As you may guess, no single sort is the winner in all categories simultaneously (Table 2).

 

It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com.
Already a member?




DevX is a division of Internet.com.
© Copyright 2010 Internet.com. All Rights Reserved. Legal Notices
advertisement