YouTube interview question

tree traversal