Meta interview question

Tree traversal, pushing elements to end of array.