算法
永恒sss
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
朴素算法BF,KMP算法
朴素算法 //朴素算法 BF算法 :1.同时向后跑 2.如果相等i++ j++ 3.如果不相等i=i-j+1 j=0 int BF_Search(const char* str, const char* sub, int pos)//从主串的pos下标开始向后找字串 { assert(str != NULL && sub != NULL && pos >= 0 && pos < strlen(str)); if (str == NULL原创 2022-03-16 14:56:25 · 415 阅读 · 0 评论 -
BST树相关函数
#include<stdio.h> #include<assert.h> #include<iostream> #include<Windows.h> #include<queue> using namespace std; // map rb_tree; //树的结构 typedef int KeyType; typedef struct BstNode { KeyType key; BstNode* leftchild; BstNode*原创 2022-03-12 02:37:26 · 590 阅读 · 2 评论 -
二叉树遍历
二叉树数据结构 typedef char Elemtype; typedef struct BtNode { Elemtype data; struct BtNode* leftchild; struct BtNode* rightchile; }BtNode,*BinaryTree; 二叉树中序遍历 递归 //中序遍历 void InOrder(BtNode* p)//ABC##DE##F##G#H## { if (p != NULL) { InOrder(p->leftchild原创 2022-03-07 01:05:30 · 533 阅读 · 0 评论
分享