Skip to content

Commit

Permalink
Added bogobogo sort
Browse files Browse the repository at this point in the history
  • Loading branch information
Github-Vektor committed Jan 21, 2024
1 parent d8784c2 commit ae15b62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/sorting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ __Properties__
* Average case performance O((n+1)!)

### [Bogo-Bogo-sort](./bogo_bogo_sort.rs)

From [leonardini.dev][bogo-bogo-doc]: BogoBogo Sort is a humorously inefficient sorting algorithm inspired by the original Bogosort. It adds a layer of complexity by recursively sorting the first n-1 elements before placing the nth element. This process is repeated until the array is sorted. The algorithm's performance is exceptionally poor, making it impractical for sorting but a useful tool for educational purposes, especially in understanding algorithm efficiency and recursive functions.
From [leonardini.dev][bogo-bogo-doc]: BogoBogo Sort is a humorously inefficient sorting
algorithm inspired by the original Bogosort. It adds a layer of complexity by recursively
sorting the first n-1 elements before placing the nth element. This process is repeated until
the array is sorted. The algorithm's performance is exceptionally poor, making it impractical
for sorting but a useful tool for educational purposes, especially in understanding
algorithm efficiency and recursive functions.

__Properties__
* Worst case performance (unbounded, extremely poor)
Expand Down Expand Up @@ -216,8 +220,6 @@ __Properties__
[bogo-wiki]: https://en.wikipedia.org/wiki/Bogosort
[bogo-image]: https://upload.wikimedia.org/wikipedia/commons/7/7b/Bogo_sort_animation.gif

[bogo-bogo-doc]: https://yaav.leonardini.dev/algorithms/sorting/bogobogo-sort.html

[bubble-toptal]: https://www.toptal.com/developers/sorting-algorithms/bubble-sort
[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"
Expand Down
4 changes: 2 additions & 2 deletions src/sorting/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ mod bead_sort;
mod binary_insertion_sort;
mod bingo_sort;
mod bitonic_sort;
mod bogo_bogo_sort;
mod bogo_sort;
mod bubble_sort;
mod bucket_sort;
Expand Down Expand Up @@ -34,12 +33,13 @@ mod tim_sort;
mod tree_sort;
mod wave_sort;
mod wiggle_sort;
mod bogo_bogo_sort;

pub use self::bogo_bogo_sort::bogo_bogo_sort;
pub use self::bead_sort::bead_sort;
pub use self::binary_insertion_sort::binary_insertion_sort;
pub use self::bingo_sort::bingo_sort;
pub use self::bitonic_sort::bitonic_sort;
pub use self::bogo_bogo_sort::bogo_bogo_sort;
pub use self::bogo_sort::bogo_sort;
pub use self::bubble_sort::bubble_sort;
pub use self::bucket_sort::bucket_sort;
Expand Down

0 comments on commit ae15b62

Please sign in to comment.