Visual Sorter and sound

  scripts
  sprites
See inside
Instructions

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:
Selection sort
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
Splay sort

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

Notes and Credits

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

Shared: 6 Dec 2017 Modified: 1 Feb 2018
Favorite this project 8
Love this project 11
Total views 169
View the remix tree  1
  
More projects by Not_O_n_log_n_