- 博客(4)
- 收藏
- 关注
原创 【字符串】字符串匹配
1.朴素匹配法#include <iostream> using namespace std; void naive_string_match( char *txt , char *pat) { int len_txt = strlen(txt); int len_pat = strlen(pat); int i, j ; for( i=0; i<len_txt...
2018-04-16 01:26:45 194
原创 【动态规划】01背包
#include<iostream> #include<algorithm> #include<vector> using namespace std; const int N = 6; const int W = 12; int x[N]; int main() { int weight[N] = {4, 6, 2, 2, 5, 1}; int v...
2018-04-15 22:12:07 111
原创 【动态规划】求最大公共子序列
算法没搞好啊!!#include<iostream> #include<string> using namespace std; const int MAX = 100; void LCSLength(string x, string y, int xlen, int ylen, int c[][MAX], int b[][MAX]) { int i, j; for...
2018-04-15 14:45:59 147
原创 【排序】
一、冒泡排序int main() { int array[]={34,65,12,43,67,5,78,10,3,70}; int len=sizeof(array)/sizeof(int); for(int i=0; i<len-1 ;i++) { for(int j=i; j<len; j++) { if(arra...
2018-04-14 00:39:35 263
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人