摘要: // 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... 阅读全文
posted @ 2019-03-07 20:25 Kiss_the_rain 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 9088 阅读全文
posted @ 2019-03-06 19:50 Kiss_the_rain 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 题目: 代码 答案:35 阅读全文
posted @ 2019-03-03 21:51 Kiss_the_rain 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 题目: 代码: 阅读全文
posted @ 2019-03-03 21:29 Kiss_the_rain 阅读(157) 评论(0) 推荐(0) 编辑
摘要: // 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... 阅读全文
posted @ 2019-02-28 17:33 Kiss_the_rain 阅读(494) 评论(0) 推荐(0) 编辑
摘要: // 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... 阅读全文
posted @ 2019-02-28 17:32 Kiss_the_rain 阅读(573) 评论(0) 推荐(0) 编辑
摘要: // 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... 阅读全文
posted @ 2019-02-28 15:22 Kiss_the_rain 阅读(159) 评论(0) 推荐(0) 编辑
摘要: // 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); ... 阅读全文
posted @ 2019-02-28 13:19 Kiss_the_rain 阅读(124) 评论(0) 推荐(0) 编辑
摘要: // 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... 阅读全文
posted @ 2019-02-25 23:00 Kiss_the_rain 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 转自 https://www.jianshu.com/p/4d0b005782d9 阅读经典——《算法导论》04 在算法分析中,我们通常会得到一个关于输入规模n的递归式,形式如下: <small>(式4-1)</small> T(n) = aT(n/b) + f(n) 例如,归并排序递归式 T(n) 阅读全文
posted @ 2019-02-24 21:39 Kiss_the_rain 阅读(2250) 评论(0) 推荐(0) 编辑