Convert BST to Sorted Doubly Linked List (LC #426) modifies the tree in-place. Use in-order traversal which visits nodes in sorted order. Maintain a previous pointer and a head pointer. For each node, link previous.right to current and current.left to previous. Update previous to current. After traversal, connect head and the last node to make it circular. This runs in time and space for recursion. Meta tests if you can do pointer manipulation without losing references.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/meta-interview-prep/trees/convert-bst-to-sorted-doubly-linked-list
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░███████████████████████████████████████████████████████████████████████████████████████████████