if (root.left != null) { convertNode(root.left); }
root.left = mLastNode;
if (mLastNode != null) { mLastNode.right = root; }
mLastNode = root;
if (root.right != null) { convertNode(root.right); } }
publicstaticvoidmain(String[] args){ TreeNode root = new TreeNode(2); root.left = new TreeNode(1); root.right = new TreeNode(3); new Solution().convert(root); } }