【数据结构7】查找
来源:互联网 发布:python 异或加密算法 编辑:程序博客网 时间:2024/06/05 18:52
- 1基本概念
- 2顺序查找
- 3折半查找
- 4B-tree和Btree
- 5散列Hash哈希表
- 6字符串模式匹配
1基本概念
2顺序查找
3折半查找
4B-tree和B+tree
5散列(Hash哈希)表
6字符串模式匹配
/** * Copyright ? 2016 Authors. All rights reserved. * * FileName: .cpp * Author: Wu_Being <1040003585@qq.com> * Date/Time: * Description: */#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>using namespace std;typedef long long LL;typedef unsigned long long ULL;typedef pair<int, int> Pii;const int inf = 0x7e7e7e7e;const LL infLL = 0x7e7e7e7e7e7e7e7eLL;const unsigned uinf = 0xfcfcfcfc;const ULL uinfLL = 0xfcfcfcfcfcfcfcfcLL;char s[100000];void get_next(char T[],int next[]){ //T[0]存放T的长度 int i=1; next[1]=0; int j=0; while(i<=T[0]){ if(j==0||T[i]==T[j]){ i++;j++;next[i]=j; }else{ j=next[j]; } }}int KMP(char S[],char T[],int next[],int pos){//1<=pos<=strlen(s) 从主串的pos位置开始 int i=pos;int j=1; while(i<=S[0]&&j<=T[0]){ if(j==0||S[i]==T[j]){ i++;j++; }else{ j=next[j]; } }}void input(){ scanf("%s",s+1); s[0]=strlen(s); cout<<strlen(s)<<endl; cout<<s[0]<<endl; printf("%d ",s[0]); cout<<s+1<<endl;}int main(int argc,char* argv[]){ input(); //KMP(); return 0;}
Wu_Being 博客声明:本人博客欢迎转载,请标明博客原文和原链接!谢谢!
《【数据结构7】查找》
http://blog.csdn.net/u014134180/article/details/55506265
如果你看完这篇博文,觉得对你有帮助,并且愿意付赞助费,那么我会更有动力写下去。
0 0
- 【数据结构7】查找
- 数据结构 第7章 查找
- 数据结构查找
- 查找 -数据结构
- 数据结构 查找
- 查找 -数据结构
- 数据结构 - 查找
- 数据结构--查找
- 查找 -数据结构
- 查找 -数据结构
- 数据结构 查找
- 数据结构:查找
- 【数据结构】查找
- 数据结构-查找
- 查找 -数据结构
- 数据结构-查找
- 数据结构-----查找
- 查找 -数据结构
- css选择器
- 【数据结构6】图
- 项目管理---git----遇到问题------.gitignore不起作用
- 解析XML
- 使用迭代器遍历List的时候修改List报ConcurrentModificationException异常原因分析
- 【数据结构7】查找
- 使用nodejs对kafka、zookeeper数据进行消费consumer
- WebApi 接口返回值不困惑:返回值类型详解
- java中遍历类中的属性和属性值
- android 自定义打印log类
- 【数据结构8】排序
- Android Alertdialog弹出框设置半透明背景
- QQ登录报错:redirect uri is illegal(100010) 解决方法[官方回复]
- (位运算总结)A summary: how to use bit manipulation to solve problems easily and efficiently