自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

_计算机好苦

好好学习 天天向上

  • 博客(14)
  • 收藏
  • 关注

原创 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 su

2020-05-23 08:18:13 196

原创 1064.Complete 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 contains only nodes with keys greater than

2020-05-22 21:29:06 169 1

原创 1043.Is It a Binary Search Tree [二叉搜索树||二叉搜索树的前序转后序]

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 less than the node’s key.The right subtree of a node cont

2020-05-21 20:56:24 171

原创 1020.Tree Traversals [后序中序转层序(不建树/建树)]*附带[前序中序转后序(建树)||后序中序转前序(不建树)]

题目AC代码思路没什么好说的,重点理解那两行遍历的递归就是了,卡在那很久,注意一个左子树的个数减去右边的子树个数这类的,附参考柳神的~https://www.liuchuo.net/archives/2090理解了这个这一类就ok了#include<iostream>#include<vector>#include<map>using namespace std;vector<int>post, in;map<int, int>p

2020-05-20 11:14:04 232

原创 1110. Complete Binary Tree [判断完全二叉树]

今天开启了PAT第一题,纪念一下~~~(^▽ ^)Given a tree, you are supposed to tell if it is a complete binary tree.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (<=20) which is the total number of n

2020-05-18 23:29:27 194

原创 03.树2 List Leaves [层序遍历+建树]

03-树2 List Leaves (25分)Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (≤10) which is

2020-05-16 15:24:00 163

原创 11.散列2 Hashing [二次探测(平方探测)法]

11-散列2 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 to be H(key)=key%TSize where TSize is the maximum size o

2020-05-12 16:58:48 435

原创 11.散列1 电话聊天狂人 [分离链表法]

11-散列1 电话聊天狂人 (25分)给定大量手机用户通话记录,找出其中通话次数最多的聊天狂人。输入格式:输入首先给出正整数N(≤10​5 ),为通话记录条数。随后N行,每行给出一条通话记录。简单起见,这里只列出拨出方和接收方的11位数字构成的手机号码,其中以空格分隔。输出格式:在一行中给出聊天狂人的手机号码及其通话次数,其间以空格分隔。如果这样的人不唯一,则输出狂人中最小的号码及其通话次数,并且附加给出并列狂人的人数。输入样例:413005711862 1358862583213505

2020-05-12 15:06:28 215

原创 排序(三)-快速排序 [选取不同位置基准数]

//1.i = L; j = R; 将基准数挖出形成第一个坑a[i]。//2.j--由后向前找比它小的数,找到后挖出此数填前一个坑a[i]中。//3.i++由前向后找比它大的数,找到后也挖出此数填到前一个坑a[j]中。//4.再重复执行2,3二步,直到i == j,将基准数填入a[i]中。#include<iostream>#include<algorithm>using namespace std;void insert_sort(int a[], int n) {

2020-05-10 16:09:14 483

原创 排序算法(二)基数排序

//基数排序(只能排正整数)#include<iostream>#include<queue>#include<vector>using namespace std;//求最大的数的位数,来确定要做几次循环排序int maxbit(int data[], int n) //辅助函数,求数据的最大位数{ int maxData = data[0]; ///< 最大数 /// 先求出最大数,再求其位数,这样有原先依次每个数判断

2020-05-10 15:36:07 107

原创 10.排序5 PAT Judge [排序的灵活使用]

这道题的意思就是,交了通过编译器的就显示出来,但是一道题都没有通过编译器的就凉凉,名字都没有,通过编译器但没成绩是0,没通过的是-1,然后就这样The ranklist of PAT is generated from the status list, which shows the scores of the submittions. This time you are supposed t...

2020-05-07 10:39:38 104

原创 冒泡排序,插入排序,希尔排序,stl堆排序,归并排序(非递归)

//这个排序把我整吐了,呕~!堆排序讲得很好的例子https://blog.csdn.net/qq_36573828/artic...

2020-05-05 22:49:00 21

原创 排序(一)冒泡排序,插入排序,希尔排序,stl堆排序,归并排序(非递归)

这个排序把我整吐了,呕~!#include<iostream>#include<queue>using namespace std;void maopaosort(int a[], int n) { //冒泡排序 for (int i = 0; i < n - 1; i++) { bool flag = false; for (int...

2020-05-05 22:48:32 232

原创 08.图9 关键活动 [部分ac]

请教大佬这是出啥状况了耗在这好久了呜呜呜思路:从左到右拓扑求最短开始时间再从右到左拓扑求最长开始时间在判断关键路径假定一个工程项目由一组子任务构成,子任务之间有的可以并行执行,有的必须在完成了其它一些子任务后才能执行。“任务调度”包括一组子任务、以及每个子任务可以执行所依赖的子任务集。比如完成一个专业的所有课程学习和毕业设计可以看成一个本科生要完成的一项工程,各门课程可以看成是子任务。...

2020-05-03 18:43:38 480

空空如也

空空如也

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

TA关注的人

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