From 1fdee612433d5e9c30e2efc9c0b8ab2560a46e8b Mon Sep 17 00:00:00 2001 From: ben-burlingham Date: Sun, 15 Nov 2015 12:48:08 -0800 Subject: [PATCH] Finalizing discussion points. --- css/style.css | 11 +++ index.html | 228 ++++++++++++++++++++++++++++++++----------- js/itemgroup.js | 6 -- js/sorter.js | 1 - js/visualizer-dom.js | 6 +- js/visualizer.js | 10 +- 6 files changed, 186 insertions(+), 76 deletions(-) diff --git a/css/style.css b/css/style.css index a56d359..163548d 100644 --- a/css/style.css +++ b/css/style.css @@ -1,3 +1,13 @@ +.src { + display:block; + font-size:14px; + margin:10px 0; +} + +.title { + font-weight:bold; +} + .sorter { background:#f4f4f4; border:1px solid #bbb; @@ -38,6 +48,7 @@ .sorter-properties { height:40px; left:10px; + line-height:normal; position:absolute; top:210px; width:570px; diff --git a/index.html b/index.html index e63c829..891870d 100644 --- a/index.html +++ b/index.html @@ -14,109 +14,220 @@ Here are visualizations of common sorting algorithms. Use the comparisons counter and number of items to observe the performance of each randomized case. - [Source repository] -
+

+ + All source data is shuffled using the Fisher-Yates algorithm. + +

+ + There's a fun clip about the sounds of sorting here. + +

+ +

Quick sort discussion

+ + Source Code + +

+ Implementation +

+

-

Quicksort discussion

- used by chrome.
- source code link + Notes +

-

Mergesort discussion

+

Merge sort discussion

+ + Source Code + +

+ Implementation +

+

+

- used by firefox and safari.
- helpful: http://stackoverflow.com/questions/2967153/space-requirements-of-a-merge-sort
- source code link + Notes +

Selection sort discussion

+ + Source Code + +

+ Implementation +

+

+

- http://stackoverflow.com/questions/15799034/insertion-sort-vs-selection-sort
- finds upstram minimum and swaps with current.
- source code link + Notes +

+ data-stable='Yes' + data-adaptive='No' + data-worst-perf='O (n^2)' + data-avg-perf='O (n^2)' + data-best-perf='O (n^2)' + data-worst-memory='0'>

Insertion sort discussion

+ + Source Code +

- how is this different from bubble and selection.
- swap. highlight. fade.
- source code link + Implementation +

+

+ +

+ Notes +

Shellsort discussion

+ + Source Code + +

+ Implementation +

+

+ +

- several ways to pick gap width, but dependence on input data makes gap selection trivial.
- Insertion sort with gap of 1.
- source code link + Notes +

-

Bubble sort discussion

+ + Source Code + +

+ Implementation +

+

+

- how is this different from insertion and selection sorts.
- talk about turtles and rabbits, because search loops from beginning each time. Every number out of place means a new pass must be done.
- source code link + Notes +