
数据结构
辣鸡诶嘿嘿
我就是个懒鬼。
展开
-
(一)数据结构-串-朴素模式匹配-KMP模式匹配-KMP模式匹配优化
话不多说,直接上代码,具体注释在代码里 但是有几个概念需要注意 1.主串:S=“google” 2.子串:主串S中的某一连续的一部分 3.模式串:一个想要在主串S中寻找到相同部分地串,可以不存在 具体思想就不说了,这个代码是能成功运行的。 #include<stdio.h> #include<iostream> #include<string.h> #include<stdlib.h> using namespace std; #define MAXLEN原创 2021-10-21 10:43:59 · 128 阅读 · 0 评论 -
PTA 6-9 二叉树的遍历 (25分) 数据结构 C语言
6-9 二叉树的遍历 (25分) 本题要求给定二叉树的4种遍历。 函数接口定义: void InorderTraversal( BinTree BT ); void PreorderTraversal( BinTree BT ); void PostorderTraversal( BinTree BT ); void LevelorderTraversal( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef Posi原创 2020-08-07 23:42:01 · 1120 阅读 · 0 评论