Linked List
114. Flatten Binary Tree to Linked List
In preorder, a node is followed by its entire left subtree and then its right subtree — so flattening means splicing the left subtree in between the node and its right subtree. The elegant O(1)-space…
Loading…