A maze solver implemented using disjoint sets and path compression and union-by-size.