04 2019 档案

摘要:1 #include 2 #include 3 4 int *temp; // 暂存数组 5 // 归并 6 void merge(int sz[], int m, int n, int p) 7 { 8 int i = m, j = n + 1, k = m; 9 while (i temp[j]) 12 sz[k++] = t... 阅读全文
posted @ 2019-04-25 08:30 sqdtss 阅读(121) 评论(0) 推荐(0) 编辑
摘要:对sb而言很难想象一段..的时光。 阅读全文
posted @ 2019-04-23 22:38 sqdtss 阅读(445) 评论(0) 推荐(0) 编辑
摘要:Social scinence is that branch of intellectual enquiry which seeks to study humans and their endeavors in the same resoned, orderly, systematic, and d 阅读全文
posted @ 2019-04-23 22:28 sqdtss 阅读(113) 评论(0) 推荐(0) 编辑
摘要:Allen's contribution was to take an assumption we all share——that because we are not robots we therefore control our thoughts——and reveal its erroneou 阅读全文
posted @ 2019-04-21 22:12 sqdtss 阅读(178) 评论(0) 推荐(0) 编辑
摘要:They may teach very well, and more than earn their salaries, but most of them make little or no independent reflections on human problems which involv 阅读全文
posted @ 2019-04-21 22:06 sqdtss 阅读(99) 评论(0) 推荐(0) 编辑
摘要:We are obliged to them because some of these languages have since vanished, as the peoples who spoke them died out or became assimilated and lost thei 阅读全文
posted @ 2019-04-21 21:50 sqdtss 阅读(161) 评论(0) 推荐(0) 编辑
摘要:#include #include using namespace std; // 将元素i向下调整 void adjust_down(int sz[], int i, int len) { int k; sz[0] = sz[i]; // sz[0]位置暂存 for (k = i sz[k] && k sz[0]) // 筛选结束 { ... 阅读全文
posted @ 2019-04-20 08:11 sqdtss 阅读(81) 评论(0) 推荐(0) 编辑
摘要:Scientists jump to the rescue with some distinctly shaky evidence to the effect that insects would eat us up if birds failed to control them.(2010, 46 阅读全文
posted @ 2019-04-19 23:03 sqdtss 阅读(141) 评论(0) 推荐(0) 编辑
摘要:Television is one of the means by which these feelings are created and conveyed——and perhaps never before has it served so much to connect different p 阅读全文
posted @ 2019-04-19 22:58 sqdtss 阅读(130) 评论(0) 推荐(0) 编辑
摘要:Dawin was conviced that the loss of these tastes was not only a loss of hapiness,but might possibly be injurious to the intellect, and more probably t 阅读全文
posted @ 2019-04-19 22:49 sqdtss 阅读(159) 评论(0) 推荐(0) 编辑
摘要:1 //问题描述: 试编写一个算法,使之能够在数组L[1...n]中找出第k小的元素(即从小到大排序后处于第k个位置的元素) 2 3 #include 4 5 // 结合快排思想,查找第5小函数 6 int find_the_minist_k(int sz[], int k, int low, int high) 7 { 8 int lowtemp = low, h... 阅读全文
posted @ 2019-04-19 22:12 sqdtss 阅读(701) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 #include 3 using namespace std; 4 5 // 简单选择排序 6 void select_sort(int sz[], int len) 7 { 8 for (int i = 0; i < len; i++) 9 { 10 // 选择出剩余为排序子数组中最小(大)值,加到已排序子数组中... 阅读全文
posted @ 2019-04-19 21:24 sqdtss 阅读(126) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 3 /** 4 * 快速排序因为是递归的,需要借助一个递归工作栈来保存每层递归调用的必要信息,其容量与递归调用的最大深度一致。 5 * 最好情况下为[log2(n+1)](上取整), 最坏情况下因为要进行n-1次递归调用,所以栈的深度为O(n),平均情况下栈的深度为O(log2n) 6 * 快速排序的平均时间复杂度为O(nlog2n),最坏情况下为... 阅读全文
posted @ 2019-04-19 21:17 sqdtss 阅读(138) 评论(0) 推荐(0) 编辑
摘要:#include // 希尔排序 void shell_sort(int sz[], int len) { // 对顺序表做希尔排序,本算法和直接插入排序相比,做了一下修改: //1.前后记录位置的增量是dk,不是1 //2.sz[0]只是暂存单元,不是哨兵 //3.希尔排序是不稳定的排序(当相同的关键字被划分到不同的子表中时,可能会改变他们的相对次序) ... 阅读全文
posted @ 2019-04-19 20:47 sqdtss 阅读(110) 评论(0) 推荐(0) 编辑
摘要:设有一个仅由红、白、蓝三种颜色的条块组成的条块序列,请编写一个时间复杂度为O(n)的算法,使得这些条块按红、白、蓝的顺序排好,即排成荷兰国旗图案。 1 #include 2 #include 3 using namespace std; 4 5 typedef enum 6 { 7 RED, 8 WHITE, 9 BLUE 10 } color; /... 阅读全文
posted @ 2019-04-19 20:23 sqdtss 阅读(204) 评论(0) 推荐(0) 编辑
摘要:1 #include 2 3 // 直接插入排序 4 void insert_sort(int sz[], int len) 5 { 6 for (int i = 2; i sz[0]; j--) 15 { 16 sz[j + 1] = sz[j]; 17 } 18 ... 阅读全文
posted @ 2019-04-19 19:39 sqdtss 阅读(225) 评论(0) 推荐(0) 编辑
摘要:There is no doubt that gardens evidence an irrepressible urge to create, express, fashion, and beautify and that self-expression is a basic human urge 阅读全文
posted @ 2019-04-15 21:32 sqdtss 阅读(202) 评论(0) 推荐(0) 编辑
摘要:Calls to disassemble all telescopes on Mauna Kea or to ban future development there ignore the reality that astronmy and Hawiian culture both seek to 阅读全文
posted @ 2019-04-15 21:23 sqdtss 阅读(91) 评论(0) 推荐(0) 编辑
摘要:Futhermore, humans have the ablity to modify the environment in which they live, thus subjecting all other life to their own peculiar ideas and fancie 阅读全文
posted @ 2019-04-14 20:16 sqdtss 阅读(116) 评论(0) 推荐(0) 编辑
摘要:You never know how strong you are until being strong is the only choice you have. 阅读全文
posted @ 2019-04-12 22:48 sqdtss 阅读(58) 评论(0) 推荐(0) 编辑
摘要:The hardest task that computer asks of anyone is to turn the power off after he has turned it on. 阅读全文
posted @ 2019-04-12 22:47 sqdtss 阅读(195) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示