Quick Union and find from the Cursera Algotitms course