Implement a Union Find data structure that can return max element in a CC in logarithmic time