Pergunta de entrevista da empresa National Instruments

add up nodes in a binary tree and find average