Sorting (trideni JS)

Algoritmus:
Graf: Cisla: Rozdily:

Speed: (2=v2 1=v1 0=rnd)
Vysledek2: (v2)
Data2 ...

Vysledek1: (v1)
Data1 ...

Speed muze castecne ovlivnovat poradi pri rozhodovani a vzdalenost v tomto souboru. Ale pocitam, ze tak mas do 5%.
1. * http://en.wikipedia.org/wiki/Sort_algorithm
2. http://www.cs.ubc.ca ukazky Java serazovani (sorting)
3. http://digilander.libero.it ukazky serazovani, JavaApplety
4. hobbesworld.com

n=1000 prvku
1453 = 1 Bubble
1453 = 2 Bubble double
1171 = 3 Select 2d
984 = 4 Shaker (= Select 2d double) 984/1016
563 = 5 Insert 2d
422 = 6 Swap (= Select 1d)
109 = 7 Swap/4 (= /4 + Swap + Slevani 2d) 109/125 (n=5000/t=2672 n=6000/t=3844)
828 = x Select 1d double Swap
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(nk); 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

Test: Firefox 1.01, Explorer 6.0, Opera 7.54u1