Skip to content

Instantly share code, notes, and snippets.

View haritonch's full-sized avatar

Chariton Charitonidis haritonch

View GitHub Profile
@haritonch
haritonch / union-find.py
Last active February 28, 2020 14:19
Union Find implementation in Python 3
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):