adding Quick Union algorithm