FANDOM


This page is for testing speeds of various sorting algorithms.

  • The code that makes the forms on this page is on the /code.js subpage.
  • The sorting algorithms themselves can be found at the github repo: https://github.com/Shadowblazen/SortingDemo
  • The sorting methods are all part of the SortingDemo global object, so you can access them from the console on this page. Ex.
// how long does Array.prototype.sort take versus SortingDemo.quickSort?
var d = SortingDemo.randomArray(50000, 100000);
var d2 = d.slice(); // copy the array
 
// sort d and print time
console.log(SortingDemo.nativeSort(d));
 
// sort d2 and print time
console.log(SortingDemo.quickSort(d2));
 
// verify that the arrays are in fact sorted
console.log(SortingDemo.isSorted(d));
console.log(SortingDemo.isSorted(d2));

Speed Comparison DemoEdit

Quicksort Variants DemoEdit

Mergesort Variants DemoEdit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.