上一页 1 2 3 4 5 6 7 8 9 10 ··· 23 下一页
摘要: 一、为什么需要B树? 用二叉查找树在磁盘上存储数据会面临两个问题: 1、二叉树只有两个分支,数据量非常大的时候,树的高度会很大,不利于数据的查找 2、每次仅若读取一条信息,会造成大量空间的浪费 因此需要把树的高度降低,并且尽量是的每次磁盘读取都能够得到最多的信息 为解决这两个问题,B树应运而生 B树 阅读全文
posted @ 2021-04-08 23:08 XA科研 阅读(191) 评论(0) 推荐(0) 编辑
摘要: priority_queue又称优先队列,其底层用堆来进行实现。在优先队列中,队首元素一定是当前队列中优先级最高的那一个。 用处:当作最大,最小堆来使用,免去堆的一系列复杂操作。 一、priority_queue的定义 添加头文件#include<queue>,并在头文件下面加上“using nam 阅读全文
posted @ 2021-04-06 23:03 XA科研 阅读(597) 评论(0) 推荐(0) 编辑
摘要: 哨兵的作用:在查找方向的尽头设置“哨兵”免去了在查找过程中每次比较后都要判断查找位置是否越界的小技巧,在总数居较多时,效率提高很大。 未使用哨兵: #include<bits/stdc++.h> using namespace std; const int maxn=1010; #define in 阅读全文
posted @ 2021-04-06 22:13 XA科研 阅读(708) 评论(0) 推荐(0) 编辑
摘要: 堆是一棵完全二叉树,树中每个结点的值都不小于(或不大于)其左右孩子结点的值。 堆一般使用优先队列(priority_queue)实现,而优先队列默认情况下使用的是大顶堆。 堆的两个特性: 1、结构性:用数组表示完全二叉树 2、有序性:任一结点的关键词是其子树所有结点的最大值(或最小值) 最大堆,也称 阅读全文
posted @ 2021-04-03 23:04 XA科研 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 排序算法的稳定性: 如果一个待排序的序列中,存在2个相等的数,在排序后这2个数的相对位置保持不变,那么该排序算法是稳定的;否则是不稳定的。 稳定的意义:排序算法如果是稳定的,从一个键上排序,然后从另一个键上排序,第一个键排序的结果可以为第二个键排序所用 两个重要定理: 定理1:任意N个不同元素组成的 阅读全文
posted @ 2021-04-03 23:03 XA科研 阅读(67) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; const int maxn=1010; #define inf 0x3fffffff int Next[maxn]; string s1,s2; int m,n; void buildNext(){ Next 阅读全文
posted @ 2021-03-31 22:59 XA科研 阅读(49) 评论(0) 推荐(0) 编辑
摘要: PP milk (盆盆奶)is Pandas' favorite. They would line up to enjoy it as show in the picture. On the other hand, they could drink in peace only if they bel 阅读全文
posted @ 2021-03-12 00:24 XA科研 阅读(59) 评论(0) 推荐(0) 编辑
摘要: The land is for sale in CyberCity, and is divided into several pieces. Here it is assumed that each piece of land has exactly two neighboring pieces, 阅读全文
posted @ 2021-03-12 00:22 XA科研 阅读(60) 评论(0) 推荐(0) 编辑
摘要: PP milk (盆盆奶)is Pandas' favorite. They would line up to enjoy it as show in the picture. On the other hand, they could drink in peace only if they bel 阅读全文
posted @ 2021-03-11 23:43 XA科研 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 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 grap 阅读全文
posted @ 2021-03-11 22:01 XA科研 阅读(70) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 23 下一页