/** public class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val) { this.val = val; } } */ publicclassSolution{ private TreeNode head; private TreeNode curNode;
public TreeNode Convert(TreeNode pRootOfTree){ // 特殊输入的检查 if (pRootOfTree == null) returnnull;
inorder(pRootOfTree); return head; }
privatevoidinorder(TreeNode n){ // 退出边界 if (n == null) return;