Scala Quick Find and Quick Union implementations