自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(59)
  • 资源 (1)
  • 收藏
  • 关注

原创 甲级PAT 1052 Linked List Sorting (25 分)(链表)

1052Linked List Sorting(25 分)A linked list consists of a series of structures, which are not necessarily adjacent in memory. We assume that each structure contains an integerkeyand aNextpointe...

2019-02-28 16:25:00 142

原创 甲级PAT 1032 Sharing (25 分)(链表)

1032Sharing(25 分)To store English words, one method is to use linked lists and store a word letter by letter. To save some space, we may let the words share the same sublist if they share the same...

2019-02-28 16:01:57 199

原创 甲级PAT 1144 The Missing Number (20 分)

1144 The Missing Number (20 分)Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case. F...

2019-02-27 17:19:03 112

原创 甲级PAT 1152 Google Recruitment (20 分)(暴力求解)

1152 Google Recruitment (20 分)In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is super-simple, a URL co...

2019-02-27 17:03:17 311

原创 Dev c++下 [Error] ‘stoi’ was not declared in this scope

使用了万能头文件#include<bits/stdc++.h>工具-》编译器选项-》代码生成/优化-》代码生成-》将语言标准调成GUN C++11就可以成功使用stoi函数了

2019-02-27 17:00:07 4066 2

原创 甲级PAT 1145 Hashing - Average Search Time (25 分)(hash,二次方探测)

1145 Hashing - Average Search Time (25 分)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 key...

2019-02-27 16:31:41 367

原创 甲级PAT 1148 Werewolf - Simple Version (20 分)(暴力求解)

1148 Werewolf - Simple Version (20 分)Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game,player #1 said: "Pla...

2019-02-27 16:16:49 206

原创 甲级PAT 1149 Dangerous Goods Packaging (25 分)(map,vector)

1149 Dangerous Goods Packaging (25 分)When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious trou...

2019-02-27 16:06:52 149

原创 甲级PAT 1147 Heaps (30 分)(堆排序)

1147 Heaps (30 分)In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater ...

2019-02-27 15:58:54 204

原创 甲级 PAT1146 Topological Order (25 分)(拓扑排序)

1146 Topological Order (25 分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are supp...

2019-02-27 15:49:42 259

原创 甲级PAT 1123 Is It a Complete AVL Tree (30 分)(AVL,CBT)

1123 Is It a Complete AVL Tree (30 分)An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they ...

2019-02-27 15:45:16 146

原创 甲级PAT 1066 Root of AVL Tree (25 分)(AVL)

1066 Root of AVL Tree (25 分)An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by...

2019-02-24 14:56:27 206

原创 甲级PAT 1155 Heap Paths (30 分)(dfs,堆排序)

1155 Heap Paths (30 分)In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either gre...

2019-02-24 11:31:03 163

原创 甲级PAT 1151 LCA in a Binary Tree (30 分)(LCA)

1151 LCA in a Binary Tree (30 分)The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.Given any two nodes in a binary tree, you a...

2019-02-24 10:40:46 162

原创 甲级PAT 1051 Pop Sequence (25 分)(stack)

1051 Pop Sequence (25 分)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 ...

2019-02-23 22:41:23 162

原创 甲级PAT 1143 Lowest Common Ancestor (30 分)(LCA)

1143 Lowest Common Ancestor (30 分)The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.A binary search tree (BST) is recursively...

2019-02-23 18:45:24 213

原创 甲级PAT 1115 Counting Nodes in a BST (30 分)(BST)

1115 Counting Nodes in a BST (30 分)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 le...

2019-02-23 16:53:29 137

原创 甲级PAT 1099 Build A Binary Search Tree (30 分)(BST)

1099 Build A Binary Search Tree (30 分)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...

2019-02-23 15:29:40 185

原创 甲级PAT 1064 Complete Binary Search Tree (30 分)(完全二叉查找树,BST,CBT)

1064 Complete Binary Search Tree (30 分)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 key...

2019-02-23 11:26:39 824

原创 甲级PAT 1098 Insertion or Heap Sort (25 分)(插入排序和堆排序)

1098 Insertion or Heap Sort (25 分)According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort remo...

2019-02-22 23:01:03 197

原创 插入排序详细说明以及模板代码

将数组分为有序部分和无序部分,然后把无序部分的元素往有序部分中插入,最后得到的序列就是有序的,对于数组插入过程需要不断后移元素。第一个元素默认为有序。举例说明插入排序的过程下标1234值5341初始化状态,[5]为有序序列,[3,4,1]为无序序列,第一次排序先将3插入到有序序列中,插入的位置应该在找到的第一个比它大的数前面。因为3<5 ,所以3...

2019-02-22 22:57:18 281

原创 堆排序详细说明以及模板代码

堆是一棵完全二叉树,根据树中每个结点和其左右子结点的关系可分为大顶堆(结点不小于左右子结点),小顶堆(结点不大于左右子结点)堆初始化是将值存储在一个一维数组heap中,从下标1到n,可以根据这个顺序想象成一棵完全二叉树。heap[1]对应的根结点举例说明(构造大顶堆的过程)例如heap[5]={2,6,4,3,1},可以想象成这样的一棵完全二叉树,箭头可以直接忽略。。26431由于大顶堆...

2019-02-22 22:41:59 247

原创 甲级PAT 1111 Online Map (30 分)(dfs+dijkstra)

1111 Online Map (30 分)Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is the shortest, and the other...

2019-02-21 12:36:04 166

原创 甲级PAT 1087 All Roads Lead to Rome (30 分)(Dijkstra,dfs)

1087 All Roads Lead to Rome (30 分)Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most hap...

2019-02-20 15:33:34 184

原创 甲级PAT 1107 Social Clusters (30 分)(并查集)

1107 Social Clusters (30 分)When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. A social cluster is a set of...

2019-02-20 00:10:48 160

原创 甲级PAT 1072 Gas Station (30 分)(Dijkstra)

1072 Gas Station (30 分)A gas station has to be built at such a location that the minimum distance between the station and any of the residential housing is as far away as possible. However it must g...

2019-02-20 00:09:00 214

原创 甲级PAT 1043 Is It a Binary Search Tree (25 分)(二叉查找树判断)

1043 Is It a Binary Search Tree (25 分)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...

2019-02-20 00:06:36 191

原创 甲级PAT 1130 Infix Expression (25 分)(dfs,递归)

1130 Infix Expression (25 分)Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operators.Input Specific...

2019-02-19 19:59:40 123

原创 甲级PAT 1127 ZigZagging on a Tree (30 分)(中序后序转自定义层序)

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 s...

2019-02-19 19:58:18 203

原创 甲级PAT 1096 Consecutive Factors (20 分)(暴力求解)

1096 Consecutive Factors (20 分)Among all the factors of a positive integer N, there may exist several consecutive numbers. For example, 630 can be factored as 3×5×6×7, where 5, 6, and 7 are the thre...

2019-02-19 19:56:26 186

原创 甲级PAT 1094 The Largest Generation (25 分)(bfs)

1094 The Largest Generation (25 分)A 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 ...

2019-02-19 19:54:34 133

原创 甲级PAT 1079 Total Sales of Supply Chain (25 分)(bfs)

1079Total Sales of Supply Chain(25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starti...

2019-02-19 19:52:29 197

原创 甲级PAT 1076 Forwards on Weibo (30 分)(bfs)

1076 Forwards on Weibo (30 分)Weibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may follow many other users as well. Hence a social network is formed wi...

2019-02-19 19:51:33 151

原创 甲级PAT 1101 Quick Sort (25 分)(提前打表)

1101 Quick Sort (25 分)There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the p...

2019-02-19 19:50:29 221

原创 甲级PAT 1053 Path of Equal Weight (30 分)(dfs)

1053 Path of Equal Weight (30 分)Given a non-empty tree with root R, and with weight W​i​​ assigned to each tree node T​i​​. The weight of a path from R to L is defined to be the sum of the weights o...

2019-02-19 19:46:57 131

原创 甲级PAT 1103 Integer Factorization (30 分)(dfs)

1103 Integer Factorization (30 分)The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the K−P ...

2019-02-19 17:41:25 118

原创 LeetCode547. Friend Circles (并查集)

547. Friend CirclesMedium88765FavoriteShareThere are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct ...

2019-02-19 17:38:42 184

原创 甲级PAT 1154 Vertex Coloring (25 分)(set)

1154 Vertex Coloring (25 分)A proper vertex coloring is a labeling of the graph's vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at most k ...

2019-02-18 12:59:34 240

原创 甲级PAT 1059 Prime Factors (25 分)(质因子)

1059 Prime Factors (25 分)Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p​1​​​k​1​​​​×p​2​​​k​2​​​​×⋯×p​m​​​k​m​​​​.Input Specifi...

2019-02-18 12:46:36 148

原创 甲级PAT 1078 Hashing (25 分)(二次方探测Quadratic,素数)

1078 Hashing (25 分)The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is defined ...

2019-02-18 12:17:14 177

飞机大战源码(JAVA课设)

实现了所有功能,包括背景图片移动、飞机移动、敌机移动、敌机发射子弹、通过鼠标移动控制、拾取道具、选择难度等级、输入姓名、显示分数以及游戏时间等各类信息,当被敌机击中时会出现失血变化、敌机死亡特效、英雄机死亡特效。涵盖完整注释,清晰易懂

2018-12-01

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除