WeightQuickUnion algorithm with path compression created. Worse case was tested.