-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString.h
More file actions
38 lines (30 loc) · 727 Bytes
/
String.h
File metadata and controls
38 lines (30 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// Created by ys on 2019/4/12.
//
#ifndef DATASTRUCT_STRING_H
#define DATASTRUCT_STRING_H
struct Node
{
char *str;
int length;
};
typedef struct Node String;
void test();
//初始化串
void SeqStringInit(String *S, char *s);
//串的赋值操作
void SeqStringAssign(String *S, String *T);
//串的连接
void SeqStringContact(String *S, String *T);
//判断字符串是否相等
int SeqStringEqual(String *S, String *T);
//求子字符串的操作
void SubSeqString(String *S, String *Sub, int strat, int len);
int KMP(String *S, String *P, int *next);
void getNext(char * p, int * next);
//简单匹配算法
int SimpleMatching(String *S, String *P);
void testSimpleMatching();
void testString();
void testKMP();
#endif //DATASTRUCT_STRING_H