Pergunta de entrevista da empresa National Instruments

The technical question is to find the average of a binary tree and write in exact code.