This is one of the problems in 'Elements of Programming Interviews' book.
-
Convert a sorted doubly linked list into a BST
C++: http://elementsofprogramminginterviews.com/solutions/cpp/sor...
Java: http://elementsofprogramminginterviews.com/solutions/java/So...
Python: http://elementsofprogramminginterviews.com/solutions/python/...
-
Convert a BST to a sorted doubly linked list
C++: http://elementsofprogramminginterviews.com/solutions/cpp/bst...
Java: http://elementsofprogramminginterviews.com/solutions/java/BS...
Python: http://elementsofprogramminginterviews.com/solutions/python/...