Try Notedeck free · More Computer Science demos
← Notedeck 计算机 · Disjoint-set (union–find) · union by rank + path compression Try in Notedeck

Disjoint-set (union–find) · union by rank + path compression — interactive Computer Science demo

Merge elements into sets and flatten the trees — near-O(1) connectivity

Run this interactive Computer Science demo live below, or download it as a single self-contained HTML file that works offline in any browser or LMS — one of 1,900+ free interactive teaching demos on Notedeck. With Notedeck you upload your own materials and turn them into interactive courseware, question papers with answer keys, and AI-taught lessons.