Quicksort the Ruby Way
I’m gearing up to apply for my next engineering job by reviewing some classic algorithms and implementing them in Ruby.
This post is for folks who write Ruby and want to see what an idiomatic Ruby implementation of quicksort might look like. In particular, I’ve eschewed the overly terse single-letter-variable salad you so often find in example implementations of basic algorithms.
Here’s the code, followed by some basic RSpec unit tests.
Quicksort Unit Tests