2013年5月22日

求二叉树任意两点间的距离

摘要: 输入二叉树两个节点的值,求解这两个节点间的距离#include <stdlib.h>#include <stdio.h>typedef struct node{ int data; node *lchild; node *rchild;}TreeNode;int node1, node2;int length = 0;int flag = 0;bool FindNode(TreeNode *pRoot){ if (pRoot == NULL) { return false; } if (pRoot->lchild != NULL) ... 阅读全文

posted @ 2013-05-22 08:09 lzm风雨无阻 阅读(435) 评论(0) 推荐(0) 编辑

导航