
PAT—树
PAT树 结构相关练习
ZQYnn~
这个人很神秘,什么都没有写~
展开
-
PAT Advanced 1099 Build A Binary Search Tree
1099 Build A Binary Search TreeA 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 th...原创 2020-03-06 21:31:20 · 260 阅读 · 0 评论 -
PAT Advanced 1094 The Largest Generation
1094 The Largest GenerationA family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with th...原创 2020-03-04 17:12:56 · 270 阅读 · 0 评论 -
PAT Advanced 1102 Invert a Binary Tree
1102 Invert a Binary Tree The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboard so fuck o...原创 2020-03-02 18:02:42 · 247 阅读 · 0 评论 -
PAT Advanced 1086 Tree Traversals Again
1086 Tree Traversals Again 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...原创 2020-02-21 10:53:07 · 159 阅读 · 0 评论 -
PAT Advanced 1020 Tree Traversals
1020 Tree Traversals 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 travers...原创 2020-02-21 10:43:42 · 204 阅读 · 0 评论 -
PAT Advanced 1110 Complete Binary Tree
1110 Complete Binary Tree Given a tree, you are supposed to tell if it is a complete binary tree.Input Specification:Each input file contains one test case. For each case, the first line gives a p...原创 2020-02-18 16:48:09 · 162 阅读 · 0 评论