Amazon interview question

Convert a binary tree into a doubly linked list