U
Dec 21, 2025Union-Find on Grid Islands: A Picture-First Walkthrough
DSU feels abstract until you sketch parent pointers. Here's how to visualize path compression on grid problems.
Dec 21, 20254 min read0 reactions0 comments
Tag archive
DSU feels abstract until you sketch parent pointers. Here's how to visualize path compression on grid problems.

Note: This post is part of the Data Structures and Algorithm series. To see more posts from this ser...
My own notes on the union find algorithm and related examples
コード const Node = function (val) { this.val = val this.parent = this this.rank = 1 } cons...