The Most Common Doubt in DSU: Path Compression + Union by Rank
When learning DSU (Disjoint Set Union / Union Find), almost every student eventually gets this doubt:
“Path Compression reduces the height of the tree. Then why don’t we update the rank?”
And then c
yesamitsingh.hashnode.dev4 min read