![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
Del Piero
这个作者很懒,什么都没留下…
展开
-
栈合集(PAT甲级)
PAT 1051 Pop Sequence Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, if M is 5 and原创 2020-10-29 11:20:43 · 159 阅读 · 0 评论 -
并查集合集(PAT甲级)
PAT 1118 Birds in Forest Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are supposed to help the scientists to count the maximum number of trees in the fore原创 2020-10-27 11:09:44 · 188 阅读 · 0 评论 -
PAT 1135 Is It A Red-Black Tree
PAT 1135 Is It A Red-Black Tree There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties: (1) Every node is either red or black. (2) The root is black. (3) Every leaf (NULL) is black. (4)原创 2020-10-24 11:04:24 · 137 阅读 · 0 评论 -
BST合集(PAT甲级)
PAT 1099 Build 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 subtree of a node contai原创 2020-10-18 14:58:13 · 166 阅读 · 0 评论 -
PAT 1145 Hashing - Average Search Time(平方探测法)
PAT 1145 Hashing - Average Search Time The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integer keys from the table and output the average search time (the num原创 2020-10-13 23:41:41 · 100 阅读 · 0 评论 -
螺旋矩阵
常规螺旋矩阵:输入行数m和列数n,从1到m*n生成螺旋矩阵。 #include <stdio.h> int main(){ int m,n; scanf("%d%d",&m,&n); int now=1; //当前位置 int u=1,d=m,l=1,r=n; //上、下、左、右四个边界 int i=1,j=1; int matrix[m+1][n+1]={0}; while(now<=m*n){原创 2020-10-11 13:50:08 · 514 阅读 · 1 评论