Google interview question

Please create a tree algorithm (coding test1)