广度优先搜索
Eighteen__
这个作者很懒,什么都没留下…
展开
-
1004 Counting Leave(甲级)
1004 Counting Leaves (30分)A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file contains one test case. Each case starts with a line containing 0<N&原创 2020-11-18 22:35:15 · 126 阅读 · 0 评论 -
C++学习之路 | PTA(甲级)—— 1127 ZigZagging on a Tree (30分)(带注释)(精简)
1127 ZigZagging on a Tree (30分)Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences. And it is a simple standard routine to print the原创 2020-10-13 22:50:04 · 385 阅读 · 0 评论 -
C++学习之路 | PTA(甲级)—— 1020 Tree Traversals (25分)(带注释)(精简)
1020 Tree Traversals (25分)Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the corresponding binary tree.Input原创 2020-10-13 22:37:26 · 133 阅读 · 0 评论