Visual Sorter and sound
This is a project that is similar to Sound Of Sorting. You can use various list sizes, types and algorithms. By default, the list is scrambled and contains 60 items.
Algorithms and their details:
Insertion sort — inserts by swaps (all items are visible)
Bubble sort — with optimization that stops on last swap of previous pass
Cocktail sort — same optimization as bubble sort
Gnome sort — inserts by swaps
Comb sort — starts at half list size, then uses a shrink factor of 4÷3 (1.3333333333333333), with bubble sort optimization when gap size is 1
Shell sort — uses Marcin Ciura's gap sequence, extended by multiplying previous term by 2.25 and flooring
Heap sort — bottom—up heapifying, speeds up to O(n) with identical items
Merge sort — bottom—up
Quick sort — random pivot, O(n²) on identical items
Ternary quick sort — random pivot, speeds up to O(n) with identical items
Comb sort 11 — a variant of comb sort that uses 11 instead of 10 or 9 gap size for more efficient ending
std::sort_heap (gcc) — a humorous heap sort form found in C++, which is not adaptive
Binary insertion sort — a variant of insertion sort that uses binary search to find where the item should be inserted
Bogo sort — checks if sorted; if not, scrambles and repeats.
Bozo sort — checks if sorted; if not, makes a random swap and repeats.
Smooth sort — implementation from https://en.wikipedia.org/w/index.php?title=Smoothsort&diff=prev&oldid=594506787#Java_implementation which was also used in Sound Of Sorting
Radix sort (LSD) — base 2
Quick sort LR — random pivot, please report list size and type if it incorrectly sorts
Note: Insertion sort has an overhead. Bubble sort, cocktail sort, gnome sort, bogo sort and bozo sort are faster on already sorted lists. A similar thing happens with shell sort (slower passes than comb sort on sorted lists) and smooth sort.
Nearly sorted and nearly reverse list details:
3 and 8: first item at the end
4 and 9: last item at the beginning
5 and 10: first and last item swapped
6 and 11: every other adjacent pair inverted
You are allowed to copy and modify this project, but you are not allowed to modify the font called "Custom Font" (although you can copy it). If want a new text using Custom Font but don't know the letters and spacing, you must ask me, then I will give you the picture with this text.
Download Custom Font: tiny url.com/CustomFontDownload (remove the space between tiny and url)
Small Custom Font: tiny url.com/CustomFont6
Original Sound Of Sorting: http://panthema.net/2013/sound-of-sorting