Pergunta de entrevista da empresa National Instruments

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