2005 Petova stranka, Peter Mlích www.volny.cz/peter.mlich/
FREE (HTML CSS JS), Test: Firefox 1.06, Explorer 6.0, Opera 8.0

Sorting (trideni JS)

Spocitej: +
Zobraz:

Vystup
Output ...

Vstup (cisla)
Input ...

1       1       1       1       1	 2         2         2         2         2      = cpu
50.000  20.000  10.000  5.000   1.000	 10 mil    1 mil     500.000   50.000    10.000 = n
------------------------------------------------------------------------------------------------------
800 ms  280 ms  125 ms  125 ms    15 ms   -	   1500* ms   640 ms   54 ms     9 ms = Native by javascript
-	-	-	-	-	  4584* ms  300  ms   140 ms   12 ms     3 ms = Slevani 3a
-	-	-	-	-	  -	    700* ms   300 ms   26 ms     6 ms = Quick 3a
-	-	-	-	 109 ms	  -	    -	      -	      835 ms    35 ms = Swap/4 + slevani
-	-	-	-	 422 ms	  -	    -	      -	     3300 ms   134 ms = Swap
-	-	-	-	 563 ms	  -	    -	      -	     5210 ms   206 ms = Insert 2a
-	-	-	-	 984 ms	  -	    -	      -	     8770 ms   350 ms = Shaker (Select 2a dbl)
-	-	-	-	1171 ms   -	    -	      -	     6600 ms   266 ms = Select 2a
-	-	-	-	-	  -	    -	      -	     3307 ms   136 ms = Select
-	-	-	-	1453 ms	  -	    -	      -	     -	       533 ms = Bubble double
-	-	-	-	1453 ms	  -	    -	      -	     -	       620 ms = Bubble

Vysvetlivky
cpu1 = AMD 1,68 GHz as intel 2,4+ GHz, FF?2
cpu2 = Intel 2.66 GHz (quad), FF19
2a, 3a = use 2, 3 array
  1. http://www.algoritmy.net/article/75/Porovnani-algoritmu
  2. http://wikipedia.org - Quicksort
  3. http://www.cs.ubc.ca JavaApplett
  4. http://digilander.libero.it JavaApplett
  5. http://hobbesworld.com
nezarazene: * DobSort * Fast Quick Sort * Max * Shaker sort * Swap Sort
Stable: * Bubble - O(n2) * Cocktail (double Bubble) - O(n2) * Insertion - O(n2) * Bucket - O(n); requires O(k) extra memory * Counting - O(n+k); requires O(n+k) extra memory * Merge - O(n log n); requires O(n) extra memory * In-place merge - O(n2) * Binary tree - O(n log n); requires O(n) extra memory * Pigeonhole - O(n+k); requires O(k) extra memory * Radix - O(n*k); requires O(n) extra memory * Gnome - O(n2)
Unstable: * Selection - O(n2) * Shell - O(n log n) if best current version used * Comb - O(n log n) * Heap - O(n log n) * Smooth - O(n log n) * Quick - O(n log n) expected time, O(n2) worst case * Intro - O(n log n) * Patience - O(n log log n + k) worst case time, requires additional O(n + k) space, also finds the longest increasing subsequences
Impractical: * Bogo - O(n × n!) expected time, unbounded worst case. * Stupid - O(n3); recursive version requires O(n2) extra memory * Bead - O(n) or O(?n), but requires specialized hardware * Pancake - O(n), but requires specialized hardware