Question d’entretien chez Google

Please create a tree algorithm (coding test1)