上一页 1 2 3 4 5 6 7 8 ··· 14 下一页
摘要: 注:本文来自:https://www.cnblogs.com/developerY/p/3172379.html 算法过程: 1、初始化:构造一个10 n的二维数组,一个长度为n的数组用于存储每次位排序时每个桶子里有多少个元素。 2、循环操作:从低位开始(我们采用LSD的方式),将所有元素对应该位的 阅读全文
posted @ 2018-11-17 10:26 _sanjun 阅读(105) 评论(0) 推荐(0) 编辑
摘要: ``` public class MinHeapDemo { final static int MAX_LEN = 100; private int[] queue = new int[MAX_LEN]; private int size; public void add(int e) { if ( 阅读全文
posted @ 2018-11-17 10:11 _sanjun 阅读(86) 评论(0) 推荐(0) 编辑
摘要: ``` public class HeapSortDemo { public static void main(String[] args) { int[] arr = {9, 8, 7, 6, 5, 4, 3, 2, 1}; sort(arr); System.out.println(Arrays.toString(arr)); }... 阅读全文
posted @ 2018-11-17 10:11 _sanjun 阅读(141) 评论(0) 推荐(0) 编辑
摘要: ``` public class BubbleSortDemo { public static void bubbleSort(int[] a) { //一次遍历,长度a.length 1,主要是第一个最终没影响 for (int i = 1; i a[j + 1]) { int temp = a[ 阅读全文
posted @ 2018-11-17 10:10 _sanjun 阅读(101) 评论(0) 推荐(1) 编辑
摘要: ``` public class SelectionSortDemo { public static void selectSort(int[] a) { //从小到大,选择待排序的第一个数作为最小的值min int minIndex = 0; //最小值下标 int minTemp = 0; // 阅读全文
posted @ 2018-11-17 10:09 _sanjun 阅读(85) 评论(0) 推荐(0) 编辑
摘要: ``` public class MergeSortDemo { public static void merge(int[] a, int low, int mid, int high) { //建立一个临时数组,大小为归并后大小 int[] temp = new int[high low + 1 阅读全文
posted @ 2018-11-17 10:08 _sanjun 阅读(84) 评论(0) 推荐(0) 编辑
摘要: ``` public class QuickSortDemo { public static void quickSort(int[] arr) { sort(arr, 0, arr.length 1); } public static void sort(int[] arr, int low, i 阅读全文
posted @ 2018-11-17 10:07 _sanjun 阅读(87) 评论(0) 推荐(0) 编辑
摘要: UNION用的比较多union all是直接连接,取到得是所有值,记录可能有重复;union 是取唯一值,记录没有重复。 1、UNION 的语法如下: 2、 UNION ALL的语法如下: 效率: UNION和UNION ALL关键字都是将两个结果集合并为一个,但这两者从使用和效率上来说都有所不同。 阅读全文
posted @ 2018-11-17 09:57 _sanjun 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 聚集索引 一种索引,该索引中键值的逻辑顺序决定了表中相应行的物理顺序。 我们的汉语字典的正文本身就是一个聚集索引。比如,我们要查“安”字,就会很自然地翻开字典的前几页,因为“安”的拼音是“an”,而按照拼音排序汉字的字典是以英文字母“a”开头并以“z”结尾的,那么“安”字就自然地排在字典的前部。 非 阅读全文
posted @ 2018-11-17 09:42 _sanjun 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 注:本文来自https://blog.csdn.net/zhengzhb/article/details/7359385 定义:为创建一组相关或相互依赖的对象提供一个接口,而且无需指定他们的具体类。 类型:创建类模式 抽象工厂模式与工厂方法模式的区别 抽象工厂模式是工厂方法模式的升级版本,他用来创建 阅读全文
posted @ 2018-11-17 09:07 _sanjun 阅读(290) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 14 下一页