Friker/alg-vis — comment on commit 5cd53fe8f5846101f6623d65ef97164ef8220f2c
File:  line 0
By kuk0:

* code reuse [e.g. in find: you always start by finding the root; in union, you always start by doing 2 finds...]
one possible way is "template method"(?) design pattern...
for example: find(x) { while (not root) { go up; possiblyDoSomeHalvingOrSplitting(); } possiblyDoCompression(); }
then method possiblyDoSomeHalvingOrSplitting() { if (findHeuristic == HALVING or SPLITTING) { bla bla } else nothing }
possiblyDoCompression() { if (findHeuristic == COMPRESSION) { do path compression } else nothing }
hm?
[just please, don't call it possiblyDoSomeHalvingOrSplitting()]