Practice of implementing binary tree