Hire The World’s
Top Talent On Demand
Top Talent On Demand
Full-stack DevelopersFront-end DevelopersSoftware DevelopersWeb DevelopersMobile App DevelopersAI EngineersAndroid DevelopersAngularJS DevelopersDjango DevelopersDrupal DevelopersGame DevelopersHadoop DevelopersiOS DevelopersJava DevelopersJavaScript DevelopersMagento DevelopersNode.js DevelopersPHP DevelopersPostgreSQL DevelopersPython DevelopersReact.js DevelopersSalesforce DevelopersScala DevelopersUnity DevelopersWordPress DevelopersAPI DevelopersRuby on Rails DevelopersKubernetes Developers
Toptal connects the top 3% of freelance developers all over the world.
Random Initial Order
Animation, code, analysis, and discussion of 8 sorting algorithms on random initial order.
DISCUSSION
A random initial order is often used to evaluate sorting algorithms in order to elucidate the “typical” case and to facilitate mathematical analysis. For some applications, however, this does not represent the typical case, so conclusions drawn here do not generalize.
Here we see the vast difference in speed between the O(n2) elementary sorting algorithms (insert, selection, bubble) and the more advanced algorithms.
KEY
- Black values are sorted.
- Gray values are unsorted.
- A red triangle marks the algorithm position.
- Dark gray values denote the current interval (shell, merge, quick).
- A pair of red triangles marks the left and right pointers (quick).