transform a binary search tree into a sorted doubly linked list in place