摘要: 目的 主要想测试一下HashMap、LinkedHashMap和TreeMap的有序性 运行结果: 结论 共同点: HashMap,LinkedHashMap,TreeMap都属于Map;Map 主要用于存储键(key)值(value)对,根据键得到值,因此键不允许键重复,但允许值重复。 不同点: 阅读全文
posted @ 2018-09-14 11:23 LynnMin 阅读(3642) 评论(1) 推荐(1) 编辑
摘要: ``` package test; public class MergeSort { public static void main(String[] args) { // TODO Auto generated method stub int[] arr = { 10, 9, 8, 7, 6, 5 阅读全文
posted @ 2018-08-27 22:05 LynnMin 阅读(141) 评论(0) 推荐(0) 编辑
摘要: ``` package test; public class HeapSort { public static void main(String[] args) { int[] arr = {10,9,8,7,6,5,4,3,2,1}; System.out.print("排序前;"); print 阅读全文
posted @ 2018-08-27 20:15 LynnMin 阅读(102) 评论(0) 推荐(0) 编辑
摘要: ``` package demo; public class ShellSort { public static void main(String[] args) { int[] arr = {5,4,3,2,1,0}; printArr(arr); shellSort(arr); printArr 阅读全文
posted @ 2018-08-27 16:42 LynnMin 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 定义 给某一对象提供一个代理对象,并由代理对象控制对原对象的引用。 静态代理 有些情况下,一个客户不想或者不能够直接引用一个对象,可以通过代理对象在客户端和目标对象之间起到中介作用。代理模式中的角色有: 1、抽象对象角色 声明了目标对象和代理对象的共同接口,这样一来在任何可以使用目标对象的地方都可以 阅读全文
posted @ 2018-08-25 15:54 LynnMin 阅读(184) 评论(0) 推荐(0) 编辑
摘要: ``` package demo; / 快速排序; @author Lynn / public class QuickSort { public static void main(String[] args) { int[] arr = { 50, 10, 90, 30, 70, 40, 80, 6 阅读全文
posted @ 2018-08-25 14:46 LynnMin 阅读(169) 评论(0) 推荐(0) 编辑
摘要: ``` package demo; / 插入排序; @author Lynn / public class InsertionSort { public static void main(String[] args) { int[] arr = {10,7,2,4,8,6,1,9}; System. 阅读全文
posted @ 2018-08-24 14:06 LynnMin 阅读(106) 评论(0) 推荐(0) 编辑
摘要: ![](https://images2018.cnblogs.com/blog/873621/201808/873621-20180824111355556-1769590637.png) 阅读全文
posted @ 2018-08-24 11:14 LynnMin 阅读(173) 评论(0) 推荐(0) 编辑
摘要: ``` package demo; / 简单排序 时间复杂度O(n^2) 不稳定; @author Lynn / public class SimpleSelectSort { public static void main(String[] args) { int[] arr = {10,7,2, 阅读全文
posted @ 2018-08-24 11:11 LynnMin 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 运行结果 阅读全文
posted @ 2018-08-23 17:37 LynnMin 阅读(127) 评论(0) 推荐(0) 编辑