Amazon Interview Question

Write a function to calculate the height of a tree?