
数据结构及实现
文章平均质量分 58
Parzivval
。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【经典算法】KMP
KMP原创 2023-05-11 11:44:24 · 81 阅读 · 0 评论 -
【经典算法】AC自动机
Ac自动机;字典树原创 2023-04-05 19:47:47 · 495 阅读 · 0 评论 -
数据结构排序
#include<iostream>#include<string>#include <algorithm>#include <vector>#include <queue>#include <cstring>#include <map>#include <set>#include <stack>#include <math.h>#include <string.原创 2020-11-19 18:05:41 · 121 阅读 · 0 评论 -
考研408专业课最重要的三个排序算法(堆排,归并,快排)
#include <bits/stdc++.h>using namespace std;int myArray[1000]={0};void arrayPrint(int arr[],int s,int e){ for(int i=s;i<e;i++)printf("%d ",arr[i]); printf("\n\n");}void MaxHeapAdject(int arr[],int root,int length){ for(int i=len.原创 2020-06-26 18:26:22 · 925 阅读 · 0 评论 -
堆的C++实现
#include<iostream>#include<cstdio>#define e -1#define initiate 100#define increase 10using namespace std;class heap {private: int *m_heap; int i; int maxsize;public:...原创 2018-11-29 17:12:27 · 938 阅读 · 0 评论 -
平衡树的C++实现
#include<iostream>#define EH 0#define LH 1#define RH -1#define empty -1000using namespace std; struct node *PtrToLNode;typedef struct node{ int data; struct node* rchild; ...原创 2018-12-02 21:27:37 · 591 阅读 · 0 评论 -
数据结构:堆
堆常用来实现优先队列,在这种队列中,待删除的元素为优先级最高(最低)的那个。在任何时候,任意优先元素都是可以插入到队列中去的,是计算机科学中一类特殊的数据结构的统称一、堆的定义最大(最小)堆是一棵每一个节点的键值都不小于(大于)其孩子(如果存在)的键值的树。大顶堆是一棵完全二叉树,同时也是一棵最大树。小顶堆是一棵完全完全二叉树,同时也是一棵最小树。注意:堆中任一子树亦是堆。以上讨论...转载 2018-11-28 12:34:57 · 155 阅读 · 0 评论 -
数据结构--并查集的原理及实现
一,并查集的介绍 并查集(Union/Find)从名字可以看出,主要涉及两种基本操作:合并和查找。这说明,初始时并查集中的元素是不相交的,经过一系列的基本操作(Union),最终合并成一个大的集合。而在某次合并之后,有一种合理的需求:某两个元素是否已经处在同一个集合中了?因此就需要Find操作。并查集是一种 不相交集合 的数据结构,设有一个动态集合S={s1,s2,s3,.....sn...转载 2019-01-17 11:37:09 · 288 阅读 · 0 评论 -
五种内部排序C语言实现
1.插入排序:bool Insert(List L, ElementType X) { if (L == NULL)return false; if (L->Last == MAXSIZE - 1)return false; for (int i = 0; i <= L->Last; i++) if (L->Data[i] == X)return false...原创 2019-06-01 16:28:53 · 818 阅读 · 0 评论