Concept
Union-find tracks which nodes belong to the same group, with near-constant time find and union once path compression and union by rank are added. It answers connectivity questions as edges arrive.
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Union-find doing its job.
class UnionFind:
def __init__(self, n):
self.parent = list(range(n))
def find(self, x):
while self.parent[x] != x:
self.parent[x] = self.parent[self.parent[x]] # path halving
x = self.parent[x]
return x
def union(self, a, b):
ra, rb = self.find(a), self.find(b)
if ra == rb: return False # already connected
self.parent[rb] = ra
return TrueComparing parent[a] == parent[b] to test connectivity. Only the roots say whether two nodes share a set; always compare find(a) with find(b).
Your roadmap puts these before Union-find, unless you already know them.
Once a session shows you understand Union-find, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.