自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 串的基本操作

日常

2022-07-14 20:08:58 66 1

原创 队列的链式存储

日常博客

2022-07-03 20:45:12 107

原创 队列的顺序存储

日常博客

2022-07-03 20:29:00 97

原创 车厢调度问题

日常博客

2022-07-03 20:06:54 146

原创 后缀表达式求值

日常

2022-07-01 08:56:11 54

原创 括号的匹配(只有小括号)

日常

2022-07-01 08:39:11 110

原创 数制转化代码

日常博客

2022-07-01 08:12:11 136

原创 顺序栈的基本运算

日常博客

2022-07-01 08:01:03 95

原创 约瑟夫环问题

日常博客

2022-06-29 23:15:23 43

原创 6.29带头节点单链表

日常博客

2022-06-29 22:42:33 100

原创 6.29之顺序表

个人博客

2022-06-29 22:04:46 46

原创 优化的kmp算法

#include<iostream>#define maxlen 200typedef struct stringnode{ char ch[maxlen]; int length;}sstring;void get_next(sstring t,int next[],int nextval[]){ int i=1; int j=0; next[1]=0; while(i<t.length){ if(j==0||t.ch[i]==t.ch[j]){ ++i;

2021-11-29 22:34:07 164

原创 kmp算法

其实核心难点在于next数组的求解。kmp算法的本质就是想偷懒。代入自己的大脑,如果你在比较两个字符串时只有最后一位不一样,接下来你会怎么做呢。你的做法就是kmp的做法#include<iostream>#define maxlen 200typedef struct stringnode{ char ch[maxlen]; int length;}sstring;int index(sstring s,sstring t){ int k=1; int i=k;int j=1;

2021-11-29 22:09:04 61

原创 朴素模式匹配算法

最基础子串比对代码,时间复杂度为O(mn)。#include<iostream>#define maxlen 200typedef struct stringnode{ char ch[maxlen]; int length;}sstring;int index(sstring s,sstring t){ int k=1; int i=k;int j=1; while(i<=s.length&&j<=t.length){ if(s.ch[i]=

2021-11-29 21:12:44 96

原创 串的存储方式

注意下面代码均不使用c++自带stl请不要在头文件添加#include#include <iostream>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */#define maxlen 40typedef struct{ char ch[maxlen]; int length;}sstri

2021-11-29 20:53:57 276

原创 链栈在括号匹配中的写法

我看了一下,大部分的使用的是顺序栈,我用链栈来试一试如果有问题欢迎留言#include <iostream>#include <cstdlib>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */#include <cstring>#include<cstdio&gt

2021-11-28 21:31:21 348

原创 循环双链表

循环双链表相较于普通双链表只要记住所有的NULL改为头指针即可,本文提供循环双链表的考研写法#include <iostream>#include <cstring>#include <cstdlib>using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */typedef st

2021-11-26 23:33:24 592

原创 归并排序,代码有疑惑·评论区留言

经典的归并排序写法#include<iostream>using namespace std;int n;int a[2500];//归并排序 int b[2500];int merge(int a[],int start,int end,int b[]);int merge_sort(int a[],int start,int end,int b[]){ if(start>=end) return 0; merge_sort(a,start,(start+end)/

2021-11-14 10:25:49 188

原创 快速排序代码,有不懂留言解答

这是快速排序的一种写法,pivot点取中间#include<iostream>using namespace std;int n;int a[10000];int quick_sort(int a[], int start, int end) { if (start >= end) { return 0; } int left = start, right = end; int pivot = a[(start + end) / 2];//pivot的选取不能是首尾,

2021-11-13 19:35:04 356

原创 字符串带空格,用函数求长度

getline(cin,s);

2021-11-11 18:16:48 994

原创 字符串大小写转换函数

#include<string.h> #include<stdio.h> int main(void){ char str[20] = "wWw.dotCpp.coM", *ptr; ptr = strupr(str); printf("%s\n", ptr); return 0; }

2021-11-11 17:53:28 118

原创 字符串查找

字符串查找目标字符串经典的strstr功能#include <iostream>#include <cstring> #include <cstdlib>using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */string source,target;//strstr字符

2021-11-09 16:23:01 47

原创 最长回文子串的动态规划做法

前面我们已经掌握了背向双指针的做法,接下来我们试一下动态规划做法#include <iostream>#include <cstring> #include <cstdlib>using namespace std; /* run this program using the console pauser or add your own getch, system("pause") or input loop */string s;int a[2500][

2021-11-09 13:42:06 42

原创 单链表总结

单链表总结,适用于平时复习,或者板子,综合了信息学竞赛写法和考研数据结构写法#include <iostream>#include<cstdlib>using namespace std;typedef struct Lnode{ int data; struct Lnode *next;}Lnode,*linklist;/* run this program using the console pauser or add your own getch, system

2021-10-22 11:38:20 98

原创 汇编语言小写字母转大写字母

DATAS SEGMENTBUF DB 82 DUP(?)DATAS ENDSSTACKS SEGMENTSTACKS ENDSCODES SEGMENT ASSUME CS:CODES,DS:DATAS,SS:STACKSSTART: MOV AX,DATAS MOV DS,AX MOV ES,AX ;段寄存器初始化 MOV BX,OFFSET BUF ;BX指向字符行缓冲区首址B...

2021-05-25 21:12:24 3846

原创 顺序表的链式存储

顺序表的链式存储有带头节点和不带头节点的两种操作总的来说,带头节点的好处要大于不带头节点。#include<stdio.h>#include<stdlib.h>typedef struct LNode{ int data;//Elemtype data; struct LNode* next;}Lnode,*LinkList;//不带头结点bool IntiList1(LinkList& L){ L = NULL; return true;

2021-03-31 20:24:04 275

空空如也

空空如也

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

TA关注的人

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