摘要:
#include#include#include#include#includeusing namespace std;//求最大公约数int gcd(int a, int b){ if (b == 0) return a; return gcd(b,a%b);}//---... 阅读全文
摘要:
#include#includeusing namespace std;void Print_LCS(int **b, string X,int m, int n);void LCS_Length(string X, string Y){ int m = X.length(); int ... 阅读全文
摘要:
//全排列问题void Perm(string list, int i){ if (i == list.length()) { for (int c = 0; c < list.length(); c++) { cout << list.... 阅读全文
摘要:
#include#includeusing namespace std;//rn=max(pi+rn-1)int Cut_Rod(int *p, int n){ if (n == 0) return 0; int q = -1; for (int i = 1; i =... 阅读全文
摘要:
#include#include#include #include #include using namespace std;//朴素模式匹配void Naive_String_Matcher(string T, string P){ int n = T.length(); int m ... 阅读全文
摘要:
#includeusing namespace std;class Queue{ int data[10]; int head; int tail;public: Queue(); void Enqueue(int dat); int Dequque();};Qu... 阅读全文
摘要:
#includeusing namespace std;class Stack{ int top; int data[10];public: Stack(); bool empty(); void push(int dat); int pop();};Stack:... 阅读全文
摘要:
void Swap(int *a, int *b) { int c = *a; *a = *b; *b = c; } 阅读全文
摘要:
#includeusing namespace std;void SelectSort(int *A, int len){ for (int i = 0; i = 0 && A[j]>tmp; j--) A[j + 1] = A[j]; A[... 阅读全文
摘要:
#include#includeusing namespace std;int Partition(int *A, int p, int r)// 划分{ int x = A[r]; int i = p - 1; for (int j = p; j < r; j++) { ... 阅读全文