Expertsort (stylised EXPERTSORT) is a collection of EXPERT PROGRAMMER sorting algorithms.
Need help with sorting homework? EXPERTSORT is here to help.
Add this line to your application's Gemfile:
gem 'expertsort'
And then execute:
$ bundle
Or install it yourself as:
$ gem install expertsort
require 'expertsort'
[5, 4, 3, 1, 2].bogosort
=> [1, 2, 3, 4, 5]
bogosort
,bogosort!
bogobogosort
,bogobogosort!
stoogesort
,stoogesort!
slowestsort
,slowestsort!
sleepsort
,sleepsort!
Sleepsort raises a RangeError
if the array contains a negative element.
There is a rspec for EXPERTSORT at spec/expertsort/expertsort_spec.rb
.