binary tree generator
recursive traversal