Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BumbleSort

The worst sorting algorithm you'll ever love.

Overview

BumbleSort is a deliberately terrible sorting algorithm that picks two random elements, swaps them, and checks if the list happens to be sorted. It's a joke algorithm meant for entertainment, not production use.

Features

  • Randomly swaps elements until sorted
  • O(n! * n) average time complexity
  • Guaranteed to make you appreciate real sorting algorithms
  • Benchmark comparisons included

Prerequisites

  • C++17 compiler
  • CMake 3.13+
  • GoogleTest (fetched automatically)

Build

mkdir build && cd build
cmake ..
make

Run

./build/src/bumble_sort/bumble_sort

Sample Results (M1 Max)

n Time (s)
8 0.0003
10 0.40
12 52.75

Tests

cd build
ctest

Note: Unit tests are minimal given the algorithm's simplicity.

License

MIT License

Author

Rich Nistuk - rnistuk

Acknowledgments

About

A really elegant, but really bad, sorting algorithm created by J. David Eisenberg.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages