What does flatten recursion statements specifically do here?
37

the code for Flatten Binary Tree to Linked List was as given

if (root==null)
return;

TreeNode right = root.right;
flatten(root.left);

root.right = root.left;
root.left = null;

while(root.right!=null){ root = root.right;
flatten(right);
root.right = right;}

Comments (1)