摘要: Given a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3return[1,3,2].Note... 阅读全文
posted @ 2013-12-17 23:39 海滨银枪小霸王 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest le... 阅读全文
posted @ 2013-12-17 23:17 海滨银枪小霸王 阅读(73) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth... 阅读全文
posted @ 2013-12-17 22:14 海滨银枪小霸王 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 做ACM时, 时常用到这两个数据结构, 特别是处理树, 图等操作时, 似乎已经必不可缺了. 若自我构造, 则耗时巨多, 且效率堪忧. 故灵活运用, 即可如鱼得水, 信手拈来. 特记之#include#includestd:queuestd:stackusing namespace std;q... 阅读全文
posted @ 2013-12-17 10:19 海滨银枪小霸王 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Follow up for problem "Populating Next Right Pointers in Each Node".What if the given tree could be any binary tree? Would your previous solution stil... 阅读全文
posted @ 2013-12-17 00:18 海滨银枪小霸王 阅读(114) 评论(0) 推荐(0) 编辑