Pregunta de entrevista de National Instruments

Write code to get the average value from a tree.