This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self, val): | |
self.value = val | |
self.size = 1 | |
'''size holds the number of a node's offsprings | |
it is used when we apply union | |
''' | |
self.parent = self | |
def find(x): |