摘要:
// test.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include #include #include using namespace std; void s2i(string &str, int n) { stringstream ss; ss > n; } const int MaxN = 1000... 阅读全文
摘要:
// test.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include using namespace std; int sum; int *b; void merge_sort(int a[], int low, int high); void merge(int a[], int low, int mid, int hi... 阅读全文
摘要:
// test.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include using namespace std; void reverse(char a[], int low, int high) { int i = low, j = high, temp; while (i > length; cin... 阅读全文
摘要:
// test.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include using namespace std; int midSearch(int a[], int b[],int na,int nb) { int a_l = na; int b_l = nb; int *temp = new i... 阅读全文
摘要:
// test.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include #include using namespace std; //求每一位总和 int BinSearch(int a[], int low, int high, int k) { if (low k)BinSearch(a, low, mid,k); ... 阅读全文
摘要:
// test.cpp: 定义控制台应用程序的入口点。 // #include "stdafx.h" #include using namespace std; void disp(int a[], int n) { for (int i = 0; i i&&a[j] >= temp) j--; a[i] = a[j]; whi... 阅读全文
摘要:
转自 https://www.jianshu.com/p/4d0b005782d9 阅读经典——《算法导论》04 在算法分析中,我们通常会得到一个关于输入规模n的递归式,形式如下: <small>(式4-1)</small> T(n) = aT(n/b) + f(n) 例如,归并排序递归式 T(n) 阅读全文