Codes for Binary Tree example