树
Godblessuam
这个作者很懒,什么都没留下…
展开
-
1064 Complete Binary Search Tree
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 subt...原创 2019-10-22 19:20:18 · 268 阅读 · 0 评论 -
1043 Is It a Binary Search Tree
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 subt...原创 2019-10-20 10:42:59 · 252 阅读 · 0 评论 -
PAT甲级-1151 LCA in a Binary Tree
The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.Given any two nodes in a binary tree, you are supposed to find their LCA.Inpu...原创 2019-05-23 17:04:05 · 169 阅读 · 0 评论 -
PAT甲级-1138 Postorder Traversal
Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to output the first number of the postorder traversal se...原创 2019-05-23 17:06:15 · 213 阅读 · 0 评论 -
PAT甲级-1119 Pre- and Post-order Traversals
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, or preorder and inorder ...原创 2019-05-23 17:11:16 · 167 阅读 · 0 评论