Output leaf nodes in a binary tree