shad/algo2: refactoring, remove useless code
shad/algo2: rename ConstructTreeAndCalcSolution -> ConstructTreeAndCalcRepeatings
shad/algo2: take out code to function