Appinventiv interview question

Covert a tree into doubly linked list?