PAT甲级
文章平均质量分 81
好名字怎么难取
这个作者很懒,什么都没留下…
展开
-
PAT甲级1119
题目1119 Pre- and Post-order Traversals (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, or preorder and inorder traversa原创 2021-07-14 16:54:48 · 166 阅读 · 0 评论 -
PAT甲级1054
题目1054 The Dominant Color (20 分) Behind the scenes in the computer's memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called the dominant color. A str原创 2021-07-13 17:05:30 · 71 阅读 · 0 评论 -
PAT甲级1127
题目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 pri原创 2021-07-13 16:59:34 · 152 阅读 · 0 评论 -
PAT甲级1102
题目11021102 Invert a Binary Tree (25 分) 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 off.Now it’s your turn to prove that YOU原创 2021-07-13 16:53:18 · 55 阅读 · 0 评论 -
PAT甲级1086
题目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:原创 2021-07-13 16:41:01 · 105 阅读 · 0 评论 -
2021-07-13
二叉树节点构造链表形式class binNode { int date; binNode* lchild; binNode* rchild;};在里面可以加入一些别的信息,比如层次啊,这个就要在构建二叉树的时候添加了二叉树的遍历1.前序遍历也就是把访问放在函数的最前面。第一次访问这个节点的时候就访问void preTravel(binNode* tree) { result.push_back(tree->date); if (tree-&g原创 2021-07-13 16:15:27 · 70 阅读 · 0 评论 -
PAT甲级1138
题目1138 Postorder Traversal (25 分) 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 sequence of the corre原创 2021-07-11 14:23:58 · 113 阅读 · 0 评论 -
PAT甲级1022
题目1022 Digital Library (30 分) A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned an unique 7-digit number as its ID. Given any que原创 2021-07-10 20:02:09 · 100 阅读 · 0 评论 -
PAT甲级1063
题目1063 Set Similarity (25 分) Given two sets of integers, the similarity of the sets is defined to be Nc /Nt ×100%, where Nc is the number of distinct common numbers shared by the two sets, and Nt is the total number of distinct num原创 2021-07-09 12:22:58 · 110 阅读 · 0 评论 -
PAT甲级1047
题目1047 Student List for Course (25 分) Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input Specification:原创 2021-07-08 21:00:02 · 66 阅读 · 0 评论 -
PAT甲级1039
#题目1039 Course List for Student (25 分)Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes for a query...原创 2021-07-08 12:34:36 · 83 阅读 · 0 评论