Class to represent Disjoint Set Data structure
class DisjointUnionSets : NEW_LINE INDENT def __init__ ( self , n ) : NEW_LINE INDENT self . rank = [ 0 ] * n NEW_LINE self . parent = [ 0 ] * n NEW_LINE self . n = n NEW_LINE self . makeSet ( ) NEW_LINE DEDENT def makeSet ( self ) : NEW_LINE DEDENT