摘要: 原题 https://pintia.cn/problem-sets/994805260223102976/problems/994805286714327040 思路 前面看的柳大佬的,伤脑筋,我以为要会插入排序和归并排序才能做出来,其实不用,了解原理就可以了。 说一下我与大佬稍微不同的地方。对归并 阅读全文
posted @ 2021-12-10 22:37 Infinite_V胜 阅读(26) 评论(0) 推荐(0)
摘要: 思路 知识点:分治法 步骤:1、分割 2、治理 采用递归分割 递归容易出,segmentation fault。注意边界条件。 只有在分割时,用的递归。分成了一个个函数块,从始至终,只有一个原始数组,变化了边界范围,来分块。 java代码 //分治 public static int[] divid 阅读全文
posted @ 2021-12-10 19:37 Infinite_V胜 阅读(30) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cctype> #include <string> using namespace std; void insertionSort(int arr[],int len){ int i,j; for (i = 1; i < len; i++) 阅读全文
posted @ 2021-12-10 19:33 Infinite_V胜 阅读(15) 评论(0) 推荐(0)