Complete procedure for binary tree creation, traversal, leaf node calculation, and clue tree