class Z80::Utils::Sort
Z80::Utils::Sort
¶ ↑
Implementations of various sorting algorithms in Z80::Utils::Sort::Macros
Example performance results (in T-states):
Array size: 5 elements 10 elements SSort ISort QSort SSort ISort QSort Example SEQ best 733 215 846 2478 440 2326 1-periodic 733 215 1380 2478 440 3665 (1,1,1,1,1) shuffled (avg) 770 614 1450 2601 1936 3583 (3,4,2,5,1) random (avg) 770 607 1459 2598 1922 3593 (7,2,9,2,4) ordered 733 215 1076 2478 440 2326 (1,2,3,4,5) reversed 793 894 1248 2728 2989 3057 (5,4,3,2,1) worst 793 894 1770 2728 2989 4326 Array size: 20 elements 30 elements SSort ISort QSort SSort ISort QSort Example SEQ best 8818 890 5071 18958 1340 6984 1-periodic 8818 890 8885 18958 1340 11065 (1,1,1,1,1) shuffled (avg) 9173 6298 8423 19593 12967 13712 (3,4,2,5,1) random (avg) 9168 6295 8425 19589 12963 13641 (7,2,9,2,4) ordered 8818 890 5071 18958 1340 6984 (1,2,3,4,5) reversed 9818 10554 6207 21208 22619 8201 (5,4,3,2,1) worst 9818 10554 10055 21208 22619 16434 Array size: 40 elements 50 elements SSort ISort QSort SSort ISort QSort Example SEQ best 32898 1790 11076 50638 2240 14471 1-periodic 32898 1790 20625 50638 2240 23845 (1,1,1,1,1) shuffled (avg) 33847 21817 19208 51938 33001 24895 (3,4,2,5,1) random (avg) 33840 21909 19215 51911 32954 24930 (7,2,9,2,4) ordered 32898 1790 11076 50638 2240 14471 (1,2,3,4,5) reversed 36898 39184 12997 56888 60249 16469 (5,4,3,2,1) worst 36898 39184 22308 56888 60249 29829