递归
youranstray
这个作者很懒,什么都没留下…
展开
-
POJ2255—Tree Recovery
题目描述: Description Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital letters in the nodes. This is an exampl转载 2012-09-01 20:00:22 · 208 阅读 · 0 评论 -
二叉树重建——POJ2255 Tree Recovery之篇2
继POJ2255之后纠结了很久。。,看了某本书后对于二叉树有了新的更深一点的认识。。。。 对于二叉树T,可以递归定义它的前序遍历、中序遍历和后序遍历如下: PreOrder(T)=T的根节点+PreOrder(T的左子树)+PreOrder(T的右子树); InOrder(T)=InOrder(T的左子树)+T的根节点+InOrder(T的右子树); PostOrder(T)=Post原创 2012-09-13 21:10:12 · 281 阅读 · 0 评论 -
二叉树的重建——POJ2255 Tree Recovery之篇2
继POJ2255之后纠结了很久。。,看了某本书后对于二叉树有了新的更深一点的认识。。。。 对于二叉树T,可以递归定义它的前序遍历、中序遍历和后序遍历如下: PreOrder(T)=T的根节点+PreOrder(T的左子树)+PreOrder(T的右子树); InOrder(T)=InOrder(T的左子树)+T的根节点+InOrder(T的右子树); PostOrder(T)=Pos原创 2012-09-13 21:06:40 · 89 阅读 · 0 评论