Given the root of a binary tree, flatten the tree into a linked list using the same TreeNode class where the right child points to the next node in the pre-order traversal and the left child is null.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.