二叉树
文章平均质量分 83
DrinkM1lk
这个作者很懒,什么都没留下…
展开
-
PAT甲级 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 numbers in level-order. However原创 2021-09-08 21:14:04 · 147 阅读 · 0 评论 -
PAT甲级 1099 Build A Binary Search Tree (30 分)
A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes with keys less than the node's key. The right subtree of a node contains only nodes with keys greater th原创 2021-08-31 20:43:52 · 50 阅读 · 0 评论 -
PAT甲级 1086 Tree Traversals Again (25 分)
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the stack operations are: push(1); push(2); push(3); pop(); pop(原创 2021-08-30 19:14:25 · 47 阅读 · 0 评论