自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(17)
  • 收藏
  • 关注

原创 如何用KMP字符串匹配算法求出主串中所包含模式串的总个数

如何用KMP字符串匹配算法求出主串中所包含模式串的总个数#include<bits/stdc++.h>using namespace std;void getnext(int next[],string s,int len){ int j=0,k=-1; next[0]=-1; while(j<len){ if(k==-1||s[j...

2020-05-04 18:19:20 1076 3

原创 C++在类中实现二叉树的建立和遍历

C++在类中实现二叉树的建立和遍历#include<bits/stdc++.h>using namespace std;typedef struct Node{ char data; struct Node *lchild; struct Node *rchild;}Node;typedef Node* node;class ...

2020-04-23 19:13:30 270 1

原创 LRU页面置换算法的实现(c++版)

#include<bits/stdc++.h>using namespace std;class LinkStack{private: struct Node{ int elem; struct Node* next; struct Node* prev; }; struct Node* head; struct Node* tail;public: LinkStack(){ head

2020-12-08 14:05:40 1317

原创 (BY)的C++暑期小实践之期末大作业-小型浏览器的实现代码

#include<iostream>#include<cctype>#include<sstream>#include<algorithm>#include<string>#include<cstring>using namespace std;class Create;class Browser { friend ostream& operator<<(ostream& os, Brows

2020-07-15 10:05:56 2070 1

原创 自己做的一个小型异质链表加文件的读写(BY期末大作业)

#include<string>#include<iostream>#include<cstring>#include<cctype>#include<algorithm>using namespace std;class List;class Person { friend class List;protected: string name; int age; string address; string telepho

2020-07-14 11:00:34 351 3

原创 自己写的string类

#define _CRT_SECURE_NO_WARNINGS#include<iostream>#include<string.h>#include<cctype>using namespace std;class String { //符号重载(通过友元函数) friend ostream& operator<<(ostream& os, String& str);//重载流插入运算符 friend istream&

2020-07-13 10:38:48 367

原创 用类去封装一个可变长数组(Vector)

#include<cstdio>#include<cstdlib>#include<cstring>#include<iostream>#include<cctype>#include<fstream>using namespace std;template<typename T>class Vector{private: T* p; int size;public: Vector() { s

2020-06-30 20:36:44 259

原创 Trie (字典树) 的基本操作---插入,删除,单词前缀匹配等等

#include<iostream>#include<vector>#include<algorithm>#include<cctype>using namespace std;const int R = 26;typedef struct TrieTree* Position;enum Color{red,black};struct TrieTree { char ch; Color color;//red表示一个单词到此处结束,

2020-06-20 12:21:34 1029

原创 AVL树(平衡二叉树)的构建及其基本的插入操作

#include<iostream>#include<algorithm>#include<cctype>#include<fstream>#include<cstring>using namespace std;struct AVLTree { int data; struct AVLTree* left; struct AVLTree* right; int height;};//构建AVL树的基本

2020-06-05 21:19:41 350

原创 基于链接法的哈希表的构造

#include<iostream>#include<string>#include<cctype>#include<fstream>#include<algorithm>using namespace std;const int MaxSize = 97;typedef struct Element { int num; struct Element* next;}Element;typedef struct HashTab

2020-05-29 23:22:40 340

原创 基于开放地址法的哈希表(散列表)

#include<iostream>#include<string>#include<cctype>#include<fstream>#include<algorithm>using namespace std;const int MaxSize = 97;typedef struct Element { int info;//info的用处是用来标记元素是否被删除过 int num;}Element;typedef stru

2020-05-29 22:47:43 850

原创 基数排序(MSD)

#include<iostream>#include<string>#include<cctype>#include<fstream>#include<algorithm>using namespace std;int getnum(int tmp)//获取一个数的位数{ int count = 0; while (tmp) { count++; tmp /= 10; } return count;}int get

2020-05-29 13:46:21 1263

原创 最大堆(MaxHeap)的基本操作(建立,插入和删除)

#include<iostream>#include<vector>#include<algorithm>#include<map>#include<fstream>#include<cctype>using namespace std;const int INF = 0x3f3f3f;typedef struct Max_Heap { int* element; int capacity; int size;}

2020-05-26 19:21:18 1278 2

原创 二叉排序树的基本骚操作

二叉排序树的基本操作#include<bits/stdc++.h>using namespace std;struct BiTree{ int data; struct BiTree *lchild,*rchild;};typedef BiTree* node;node search(int T,node root)//二叉排序树的搜索{ nod...

2020-05-08 11:47:16 156 1

原创 一元多项式的相关运算

链表实现一元多项式的加法和乘法#include<bits/stdc++.h>using namespace std;typedef struct Node{ int ceof; int exp; struct Node* next;}Node;Node *read(string s){ Node *head,*middle,*near; ...

2020-05-06 23:31:39 184 2

原创 尝试用类封装了一下大数加法(高精度运算)

类的封装很有趣不是#include<bits/stdc++.h>using namespace std;class BigInteger{private: char str[10050]; int num[10050]={0};public: BigInteger(){} ~BigInteger(){} BigInteger(char ...

2020-04-24 09:59:23 265 1

原创 二叉树的建立(已知前序序列和中序序列)

已知二叉树前序序列和中序序列递归创建二叉树#include<bits/stdc++.h>using namespace std;typedef struct Node{ char data; struct Node *lchild; struct Node *rchild;}Node;typedef Node* node;No...

2020-04-23 19:45:41 307 1

空空如也

空空如也

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

TA关注的人

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