Pregunta de entrevista de Amazon

Convert binary tree into list, but using constant memory