Algorithm For Creating A Binary Tree