From bce30b8179c6239191b8d46c6b925c3ad90d6d6b Mon Sep 17 00:00:00 2001 From: Volodymyr Date: Thu, 4 Oct 2018 00:34:44 -0400 Subject: [PATCH 1/5] Added Bucket Sort description --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 422bc9f68..a11afcd88 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,16 @@ __Properties__ ###### View the algorithm in [action][bubble-toptal] +### Bucket +![alt text][bucket-image-1] +![alt text][bucket-image-2] + +From [Wikipedia][bucket-wiki]: Bucket sort, or bin sort, is a sorting algorithm that works by distributing the elements of an array into a number of buckets. Each bucket is then sorted individually, either using a different sorting algorithm, or by recursively applying the bucket sorting algorithm. + +__Properties__ +* Worst case performance O(n^2) +* Best case performance O(n+k) +* Average case performance O(n+k) ### Insertion @@ -148,6 +158,10 @@ Mathematically a bijective function is used on the characters' positions to encr [bubble-wiki]: https://en.wikipedia.org/wiki/Bubble_sort [bubble-image]: https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Bubblesort-edited-color.svg/220px-Bubblesort-edited-color.svg.png "Bubble Sort" +[bucket-wiki]: https://en.wikipedia.org/wiki/Bucket_sort +[bucket-image-1]: https://commons.wikimedia.org/wiki/File:Bucket_sort_1.svg#/media/File:Bucket_sort_1.svg +[bucket-image-2]: https://commons.wikimedia.org/wiki/File:Bucket_sort_2.svg#/media/File:Bucket_sort_2.svg + [insertion-toptal]: https://www.toptal.com/developers/sorting-algorithms/insertion-sort [insertion-wiki]: https://en.wikipedia.org/wiki/Insertion_sort [insertion-image]: https://upload.wikimedia.org/wikipedia/commons/7/7e/Insertionsort-edited.png "Insertion Sort" From 313d5b695b83f4c62979a7df0328d5571b6eb303 Mon Sep 17 00:00:00 2001 From: Volodymyr Date: Thu, 4 Oct 2018 00:38:38 -0400 Subject: [PATCH 2/5] Added Cocktail shaker Sort description --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index a11afcd88..1cde0908a 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,16 @@ __Properties__ * Best case performance O(n+k) * Average case performance O(n+k) +### Coctail shaker +![alt text][cocktail-shaker-image] + +From [Wikipedia][cocktail-shaker-wiki]: Cocktail shaker sort, also known as bidirectional bubble sort, cocktail sort, shaker sort (which can also refer to a variant of selection sort), ripple sort, shuffle sort, or shuttle sort, is a variation of bubble sort that is both a stable sorting algorithm and a comparison sort. The algorithm differs from a bubble sort in that it sorts in both directions on each pass through the list. + +__Properties__ +* Worst case performance O(n^2) +* Best case performance O(n) +* Average case performance O(n^2) + ### Insertion ![alt text][insertion-image] @@ -162,6 +172,9 @@ Mathematically a bijective function is used on the characters' positions to encr [bucket-image-1]: https://commons.wikimedia.org/wiki/File:Bucket_sort_1.svg#/media/File:Bucket_sort_1.svg [bucket-image-2]: https://commons.wikimedia.org/wiki/File:Bucket_sort_2.svg#/media/File:Bucket_sort_2.svg +[cocktail-shaker-wiki]: https://en.wikipedia.org/wiki/Cocktail_shaker_sort +[cocktail-shaker-image]: https://upload.wikimedia.org/wikipedia/commons/e/ef/Sorting_shaker_sort_anim.gif + [insertion-toptal]: https://www.toptal.com/developers/sorting-algorithms/insertion-sort [insertion-wiki]: https://en.wikipedia.org/wiki/Insertion_sort [insertion-image]: https://upload.wikimedia.org/wikipedia/commons/7/7e/Insertionsort-edited.png "Insertion Sort" From 8a8baf76d1158581f45d058114c00d395035b573 Mon Sep 17 00:00:00 2001 From: Volodymyr Date: Thu, 4 Oct 2018 00:43:27 -0400 Subject: [PATCH 3/5] Added Radix Sort description --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1cde0908a..99759358f 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,15 @@ __Properties__ ###### View the algorithm in [action][quick-toptal] +### Radix + +From [Wikipedia][radix-wiki]: In computer science, radix sort is a non-comparative integer sorting algorithm that sorts data with integer keys by grouping keys by the individual digits which share the same significant position and value. + +__Properties__ +* Worst case performance O(wn) +* Best case performance O(wn) +* Average case performance O(wn) + ### Selection ![alt text][selection-image] @@ -169,11 +178,11 @@ Mathematically a bijective function is used on the characters' positions to encr [bubble-image]: https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Bubblesort-edited-color.svg/220px-Bubblesort-edited-color.svg.png "Bubble Sort" [bucket-wiki]: https://en.wikipedia.org/wiki/Bucket_sort -[bucket-image-1]: https://commons.wikimedia.org/wiki/File:Bucket_sort_1.svg#/media/File:Bucket_sort_1.svg -[bucket-image-2]: https://commons.wikimedia.org/wiki/File:Bucket_sort_2.svg#/media/File:Bucket_sort_2.svg +[bucket-image-1]: https://commons.wikimedia.org/wiki/File:Bucket_sort_1.svg#/media/File:Bucket_sort_1.svg "Bucket Sort" +[bucket-image-2]: https://commons.wikimedia.org/wiki/File:Bucket_sort_2.svg#/media/File:Bucket_sort_2.svg "Bucket Sort" [cocktail-shaker-wiki]: https://en.wikipedia.org/wiki/Cocktail_shaker_sort -[cocktail-shaker-image]: https://upload.wikimedia.org/wikipedia/commons/e/ef/Sorting_shaker_sort_anim.gif +[cocktail-shaker-image]: https://upload.wikimedia.org/wikipedia/commons/e/ef/Sorting_shaker_sort_anim.gif "Cocktail Shaker Sort" [insertion-toptal]: https://www.toptal.com/developers/sorting-algorithms/insertion-sort [insertion-wiki]: https://en.wikipedia.org/wiki/Insertion_sort @@ -183,6 +192,8 @@ Mathematically a bijective function is used on the characters' positions to encr [quick-wiki]: https://en.wikipedia.org/wiki/Quicksort [quick-image]: https://upload.wikimedia.org/wikipedia/commons/6/6a/Sorting_quicksort_anim.gif "Quick Sort" +[radix-wiki]: https://en.wikipedia.org/wiki/Radix_sort + [merge-toptal]: https://www.toptal.com/developers/sorting-algorithms/merge-sort [merge-wiki]: https://en.wikipedia.org/wiki/Merge_sort [merge-image]: https://upload.wikimedia.org/wikipedia/commons/c/cc/Merge-sort-example-300px.gif "Merge Sort" From ea170ac0da2a4244755b46e8a7c539a526040f6b Mon Sep 17 00:00:00 2001 From: Volodymyr Date: Thu, 4 Oct 2018 00:48:58 -0400 Subject: [PATCH 4/5] Added Topological Sort description --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 99759358f..d0ea9155d 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,10 @@ __Properties__ ###### View the algorithm in [action][shell-toptal] +### Topological + +From [Wikipedia][topological-wiki]: In the field of computer science, a topological sort or topological ordering of a directed graph is a linear ordering of its vertices such that for every directed edge uv from vertex u to vertex v, u comes before v in the ordering. For instance, the vertices of the graph may represent tasks to be performed, and the edges may represent constraints that one task must be performed before another; in this application, a topological ordering is just a valid sequence for the tasks. A topological ordering is possible if and only if the graph has no directed cycles, that is, if it is a directed acyclic graph (DAG). Any DAG has at least one topological ordering, and algorithms are known for constructing a topological ordering of any DAG in linear time. + ### Time-Complexity Graphs Comparing the complexity of sorting algorithms (Bubble Sort, Insertion Sort, Selection Sort) @@ -206,6 +210,8 @@ Mathematically a bijective function is used on the characters' positions to encr [shell-wiki]: https://en.wikipedia.org/wiki/Shellsort [shell-image]: https://upload.wikimedia.org/wikipedia/commons/d/d8/Sorting_shellsort_anim.gif "Shell Sort" +[topological-wiki]: https://en.wikipedia.org/wiki/Topological_sorting + [linear-wiki]: https://en.wikipedia.org/wiki/Linear_search [linear-image]: http://www.tutorialspoint.com/data_structures_algorithms/images/linear_search.gif From 5db4e540a795c4d82fc1a17d1ff0f2d0c25eb7b6 Mon Sep 17 00:00:00 2001 From: Volodymyr Klymenko Date: Thu, 4 Oct 2018 01:02:30 -0400 Subject: [PATCH 5/5] update images of Bucket Sort --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d0ea9155d..8297bbca0 100644 --- a/README.md +++ b/README.md @@ -182,8 +182,8 @@ Mathematically a bijective function is used on the characters' positions to encr [bubble-image]: https://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Bubblesort-edited-color.svg/220px-Bubblesort-edited-color.svg.png "Bubble Sort" [bucket-wiki]: https://en.wikipedia.org/wiki/Bucket_sort -[bucket-image-1]: https://commons.wikimedia.org/wiki/File:Bucket_sort_1.svg#/media/File:Bucket_sort_1.svg "Bucket Sort" -[bucket-image-2]: https://commons.wikimedia.org/wiki/File:Bucket_sort_2.svg#/media/File:Bucket_sort_2.svg "Bucket Sort" +[bucket-image-1]: https://upload.wikimedia.org/wikipedia/commons/thumb/6/61/Bucket_sort_1.svg/311px-Bucket_sort_1.svg.png "Bucket Sort" +[bucket-image-2]: https://upload.wikimedia.org/wikipedia/commons/thumb/e/e3/Bucket_sort_2.svg/311px-Bucket_sort_2.svg.png "Bucket Sort" [cocktail-shaker-wiki]: https://en.wikipedia.org/wiki/Cocktail_shaker_sort [cocktail-shaker-image]: https://upload.wikimedia.org/wikipedia/commons/e/ef/Sorting_shaker_sort_anim.gif "Cocktail Shaker Sort"