My Ruby implementation of the Quick-Find/ 
Union algorithm