Algorithm · Pinterest · Medium
Requirements Given the root node of a binary search tree, transform the tree in place into a sorted circular doubly linked list. Reuse each node's left pointer as its predecessor link and its right pointer as its successor link. Return the list's head, which is the node containing the smallest value. If the tree is empty, return null. Follow-up: implement insert(head, new_value) so that a new node is added while preserving the list's sorted order. Examples The canonical 426…
Checking your access…