study algorithms in c: add quickunion and weighted quickunion