Tutorial by Examples: compress

If we do many merge operations on a union-find data structure, the paths represented by the parent pointers might be quite long. Path compression, as already described in the theory part, is a simple way of mitigating this issue. We might try to do path compression on the whole data structure after...

Page 2 of 2