/bingusort

An incredibly inefficient sorting algorithm, badly implemented in Rust.

Primary LanguageRust

🐈‍⬛ bingusort 🐈‍⬛

Bingus Build Version

An incredibly inefficient sorting algorithm, badly implemented in Rust.

My goal was to create the worst (in terms of execution time) possible algorithm that

  • is more original than bogosort - as in, not just shuffling the array,
  • would still eventually sort the list,
  • while making its implementation as fast as possible.

Engage Bingus mode with -b to make execution so slow that you can watch the program work in real time! 😎

Usage

BINGUS Sort 

USAGE:
    bingusort [OPTIONS]

OPTIONS:
    -a <array>         Input list to be sorted
    -b                 Activates BINGUS mode. Just see for yourself.
    -h, --help         Print help information
    -l <length>        Specifies length of the list
    -s <slow>          Activates slow mode, which inserts pauses between verbose outputs of
                       specified length (in ms). Does nothing when used without -v / --verbose
    -v                 Activates verbose mode

Here's what it does

  1. Bounce: Randomly select and swap elements.
  2. Inspect: Identify the largest value..
  3. Nudge: ...and laboriously shift it to the end.
  4. Glimpse: Locate the smallest value
  5. Upgrade: ...and painstakingly push it to the front.
  6. Scramble: Shuffle elements at two randomly chosen positions based on the BINGUS numerals.

If you can figure out what the time complexity of this algorithm is, let me know.