user-0 提问: 求高数解答二叉树的递归建立问题

回复:
user: user-0
content: static void CoorDinate(Node root)         {             int deepth = Deepth(root, 0);             List<Node> listNode = new List<Node>();             listChild(root, listNode);             listNode[listNode.Count - 1].X = 800;             listNode[listNode.Count - 1].Y = 600;             for (int i = listNode.Count - 1; i >= 1; i--)             {                 if (listNode[i - 1].Symbol.Length == 1)                 {                     listNode[i - 1].X = listNode[i].X - listNode[i - 1].Symbol.Length * 20 - 20;                 }                 else                 {                     listNode[i - 1].X = listNode[i].X - listNode[i - 1].Symbol.Length * 10 - 10;                 }                 listNode[i - 1].Y = listNode[i].Y - (listNode[i].Deepth - listNode[i - 1].Deepth) * 50;             }             CoorDinateHelp(root);         }         static void CoorDinateHelp(Node root)         {             if (root.NodeList == null)             {             }             else             {                 for (int i = 0; i < root.NodeList.Count; i++)                 {                     CoorDinateHelp(root.NodeList[i]);                 }                 location(root);             }   } static void location(Node node)         {             int x = 0;             if (node.NodeList.Count == 1)             {                 node.X = node.NodeList[0].X;             }             else             {                 x = (node.NodeList[node.NodeList.Count - 1].X - node.NodeList[0].X) / 2;                 node.X = node.NodeList[0].X + x;             }             node.Y = node.NodeList[0].Y - 50;        }

user: user-0
content: static void CoorDinate(Node root)         {             int deepth = Deepth(root, 0);             List<Node> listNode = new List<Node>();             listChild(root, listNode);             listNode[listNode.Count - 1].X = 800;             listNode[listNode.Count - 1].Y = 600;             for (int i = listNode.Count - 1; i >= 1; i--)             {                 if (listNode[i - 1].Symbol.Length == 1)                 {                     listNode[i - 1].X = listNode[i].X - listNode[i - 1].Symbol.Length * 20 - 20;                 }                 else                 {                     listNode[i - 1].X = listNode[i].X - listNode[i - 1].Symbol.Length * 10 - 10;                 }                 listNode[i - 1].Y = listNode[i].Y - (listNode[i].Deepth - listNode[i - 1].Deepth) * 50;             }             CoorDinateHelp(root);         }         static void CoorDinateHelp(Node root)         {             if (root.NodeList == null)             {             }             else             {                 for (int i = 0; i < root.NodeList.Count; i++)                 {                     CoorDinateHelp(root.NodeList[i]);                 }                 location(root);             }   } static void location(Node node)         {             int x = 0;             if (node.NodeList.Count == 1)             {                 node.X = node.NodeList[0].X;             }             else             {                 x = (node.NodeList[node.NodeList.Count - 1].X - node.NodeList[0].X) / 2;                 node.X = node.NodeList[0].X + x;             }             node.Y = node.NodeList[0].Y - 50;        }

user: user-1
content: 函数CreateBinTree被递归调用的过程中，遇到连续3个“#”或1个“;”均会return到上一级调用处，输入序列ABC##DE#G##F###;和ABC##DE#G##F#########;均在红色标记的#处结束整个递归过程，剩余的输入部分根本就不会处理。

user: user-0
content: 我是说  ABC##DE#G##F### 当输入最后一个"#"的时候, 它是A的右节点  ,  整个递归过程都已经结束了.分号';'是从哪个递归的分支读入的?

user: user-2
content: 全文就一个scanf，还能哪里读入……