Glossary: Algorithms Beyond the Basics in JavaScript
Path compression
A union-find trick where `find` points every item it passed on the way up straight at the root, so the next walk takes one step.
Glossary: Algorithms Beyond the Basics in JavaScript
A union-find trick where `find` points every item it passed on the way up straight at the root, so the next walk takes one step.