Pregunta de entrevista de National Instruments

Write a function to find the average of all the nodes in a binary tree.