Question d’entretien chez Bloomberg

Write a function that calculates the specific value in a tree.