Add solution for binary-tree checking algorithm