- 博客(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
228
原创 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
105
原创 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
189
原创 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
105
原创 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
147
原创 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
105
原创 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
166
原创 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
149
原创 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
174
原创 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
129
原创 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
108
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人