Amazon interview question

Convert binary search tree to linked list