Amazon Interview Question

how to count number of node in a tree.