Added improved versions of quick union algorithm.

Added QuickUnionWeighted and QuickUnionWeighted with Path Compression.
Minor changes in QuickUnion for better support of inheritance.