File tree Expand file tree Collapse file tree 1 file changed +38
-11
lines changed Expand file tree Collapse file tree 1 file changed +38
-11
lines changed Original file line number Diff line number Diff line change 1
1
# VisualSorting
2
2
3
- Sorting algorithms animated using JavaScript.
3
+ Visual representation, with auidio effect of the most common sorting algorithms written in pure javascript and HTML.
4
+
4
5
You can test it out [ here] ( https://dev-null.me/ )
5
6
7
+ [ ![ image] ( https://user-images.githubusercontent.com/50732964/160263362-be4d4874-3232-4dcf-892d-dca9e07bfae4.png )] ( https://dev-null.me/ )
8
+
9
+
6
10
## Available algorithms
7
11
8
- - Tim sort
9
- - Insertion sort
10
- - Selection sort
11
- - Quicksort
12
- - Merge sort
13
- - Bubble sort
14
- - Random sort
15
- - Stalin sort
16
- - LSD Radix sort
17
- - MSD Radix sort
12
+ ### Tim sort:
13
+ - starts with insertion sort for smaller parts (32 pieces)
14
+ - merge sort for parts created by insertion stage
15
+
16
+ ### Insertion sort
17
+ - binary search in the sorted segment and then insertion on the correct position
18
+
19
+ ### Selection sort
20
+ - selects the smallest element and puts at the end of the sorted segment
21
+
22
+ ### Quicksort
23
+ - chose random pivot (element from array)
24
+ move everything smaller to the left of the pivot and everything larger to the right
25
+ - repeat for the right part and left part separated by the pivot
26
+
27
+ ### Merge sort
28
+ - merge increasingly bigger array parts starting at 1
29
+ using 2 moving pivots
30
+
31
+ ### Bubble sort
32
+ - compare each element with the next one if the next one is smaller swap them
33
+
34
+ ### Random sort
35
+ - randomly shuffle array and hope for the best : D
36
+
37
+ ### Stalin sort
38
+ - delete each element that is not bigger than the previous one
39
+
40
+ ### LSD/MSD Radix sort
41
+ - LSD/MSD (Least/Most Significant Digit)
42
+ - Separate data into digits
43
+ - for each value create bucket and move all values with according value on current digit to that bucket repeat
44
+ - PS: MSD works better since the numbers are represented as floats with a lot of digits
You can’t perform that action at this time.
0 commit comments