From 1e6020460fa6db48f942f186a939d7a50c3b0ef7 Mon Sep 17 00:00:00 2001 From: Pablo Hildo Date: Thu, 4 Oct 2018 23:01:36 -0300 Subject: [PATCH] Added Bogo Sort README --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f71cab..c7af7e7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,14 @@ These are for demonstration purposes only. ## Sorting Algorithms ### Bogo Sort -Add comments here +![alt text][bogo-image] + +From [Wikipedia][bogo-wiki]: Bogo sort is a highly ineffective sorting function based on the generate and test paradigm. The function successively generates permutations of its input until it finds one that is sorted. It is not useful for sorting, but may be used for educational purposes, to contrast it with more efficient algorithms. + +__Properties__ +* Unbounded (randomized version), O((n+1)!) (deterministic version) +* Best case performance O(n) +* Average case performance O((n+1)!) ### Bubble Sort ![alt text][bubble-image] @@ -75,3 +82,6 @@ __Properties__ [shell-toptal]: https://www.toptal.com/developers/sorting-algorithms/shell-sort [shell-wiki]: https://en.wikipedia.org/wiki/Shellsort [shell-image]: https://upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Shell_sorting_algorithm_color_bars.svg/267px-Shell_sorting_algorithm_color_bars.svg.png "Shell Sort" + +[bogo-wiki]: https://en.wikipedia.org/wiki/Bogosort +[bogo-image]: http://www.siafoo.net/graph/d174e8328044fa36d07b25a4c0ad6631