Implementation of Union Find using Weighted Quick Union with Path Compression