Sabre Interview Question

Convert a doubly linked list to tree and vice-versa.