![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
algorithm
博诺那
这个作者很懒,什么都没留下…
展开
-
(KMP) alogrithm 实现
#include #include #include using namespace std; void get_next(const char * subStr,vector&next ) { next[0] = strlen(subStr); next[1]= 0; next[2]=1; int i = 3; int j =2; while(j < strlen(s原创 2014-04-14 19:31:31 · 469 阅读 · 0 评论 -
LCS
#include #include #include #include using namespace std; struct NODE { int nLen; string commStr; }; void LCS(string strDest,string strSur,list&nlist) { int nEnd = 0; in原创 2014-04-30 16:04:03 · 423 阅读 · 0 评论 -
斐波拉契数列-演变
斐波拉契数列-演变面试中碰到类似的算法题有如下: 爬楼梯,从第一层到第十层,每次允许一次性爬1-3层,则从第1层到第10 层总共有多少种方法,并将相应的所有步数列举出来。 解法: 设爬的层数为n,需要的总共的方法数归纳为方法f(n) 先归纳下方法:n =1:f(1) = 1; n=2; f(2) = 2; 1+1 2 n=3; f(3) = 4; 1+2 1原创 2016-08-06 18:47:24 · 420 阅读 · 0 评论 -
冒泡排序
bubbleAlgrithmvoid fun1(int *pNum,int nSize){ if(NULL != pNum){ bool bExchange = false; cout<<”before sorting:”<原创 2016-10-19 23:58:44 · 252 阅读 · 0 评论 -
二叉树动态链式创建以及遍历
// main.cpp // BinaryTree#include <iostream> using namespace std;typedef struct _BinaryTree{ char ch; _BinaryTree *pLeft; _BinaryTree *pRight; }BTreeNode;BTreeNode *g_pRoot = NULL; //crea原创 2016-11-02 00:49:23 · 1697 阅读 · 0 评论