Tree: Depth-First Search - Flatten Binary Tree to Linked List
Consider the following Python code implementing the optimal flatten function for a binary tree. Given the input tree:
1
/ \
2 3
What is the value of the global variable
prev after the call flatten(root) completes?