Pergunta de entrevista da empresa National Instruments

Write a function to find the average value of a binary tree.