摘要: 二叉树的非递归遍历 二叉树是一种非常重要的数据结构,很多其它数据结构都是基于二叉树的基础演变而来的。对于二叉树,有前序、中序以及后序三种遍历方法。因为树的定义本身就是递归定义,因此采用递归的方法去实现树的三种遍历不仅容易理解而且代码很简洁。而对于树的遍历若采用非递归的方法,就要采用栈去模拟... 阅读全文
posted @ 2014-07-30 20:33 冷夏的博客园 阅读(89) 评论(0) 推荐(0) 编辑
摘要: DescriptionLittle Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capital l... 阅读全文
posted @ 2014-07-30 19:32 冷夏的博客园 阅读(311) 评论(0) 推荐(0) 编辑
摘要: DescriptionBackgroundBinary trees are a common data structure in computer science. In this problem we will look at an infinite binary tree where the n... 阅读全文
posted @ 2014-07-30 18:30 冷夏的博客园 阅读(362) 评论(0) 推荐(0) 编辑
摘要: A -Tree Grafting(9.1.1)Time Limit:5000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionTrees have many applications in comput... 阅读全文
posted @ 2014-07-30 18:01 冷夏的博客园 阅读(280) 评论(0) 推荐(0) 编辑
摘要: A -敌兵布阵Time Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusDescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸... 阅读全文
posted @ 2014-07-30 10:58 冷夏的博客园 阅读(93) 评论(0) 推荐(0) 编辑