- 博客(11)
- 收藏
- 关注
原创 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
270
原创 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
140
原创 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
217
原创 PAT甲级1102
题目1102 1102 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
142
原创 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
177
原创 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
125
原创 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
194
原创 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
181
原创 PAT甲级1063
题目 1063 Set Similarity (25 分) Given two sets of integers, the similarity of the sets is defined to be N c /N t ×100%, where N c is the number of distinct common numbers shared by the two sets, and N t is the total number of distinct num
2021-07-09 12:22:58
207
原创 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
162
原创 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
137
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅