Union Find solutions from the Princeton Algorithms Coursera course