随笔分类 -  数据结构和算法

摘要:最后删除有点复杂,没怎么搞懂见谅。 阅读全文
posted @ 2019-05-07 18:23 花儿为何那样红 阅读(300) 评论(0) 推荐(0)
摘要:package thread1; /** * 实现一个简单的ArrayList * * @Title: uminton */ public class SimpleArrayList { //数组中元素的大小 private Integer elementSize = 0; //创建SimpleArrayList时,数组的容量,默认为16 privat... 阅读全文
posted @ 2018-11-22 12:01 花儿为何那样红 阅读(487) 评论(0) 推荐(0)
摘要:/** * 高级排序,希尔排序 * Create by Administrator * 2018/7/2 0002 * 下午 4:20 **/ class ArraySh{ private long[] theArray; private int nElems; public ArraySh(int max){ theArray = new ... 阅读全文
posted @ 2018-07-02 17:10 花儿为何那样红 阅读(169) 评论(0) 推荐(0)
摘要:/** * 并归排序 * Create by Administrator * 2018/6/26 0026 * 下午 5:13 **/ public class DArray { private long[] theArray; private int nElens; public DArray(int max){ theArray = ... 阅读全文
posted @ 2018-06-27 10:16 花儿为何那样红 阅读(228) 评论(0) 推荐(0)
摘要:/** * 合并两个数组并排序 * Create by Administrator * 2018/6/26 0026 * 下午 4:29 **/ public class MergeApp { public static void merge(int[] arrayA,int sizeA,int[] arrayB,int sizeB,int[] arrayC){ ... 阅读全文
posted @ 2018-06-26 16:54 花儿为何那样红 阅读(4165) 评论(0) 推荐(0)
摘要:/** * 递归实现二分查找法 * Create by Administrator * 2018/6/21 0021 * 上午 11:25 **/ class OrdArray{ private long[] a; private int nElems; public OrdArray(int max){ this.a = new long[m... 阅读全文
posted @ 2018-06-21 14:34 花儿为何那样红 阅读(674) 评论(0) 推荐(0)
摘要:/** * 递归 * Create by Administrator * 2018/6/20 0020 * 上午 9:41 **/ public class TriangleApp { static int theNumber; public static void main(String[] args) throws IOException{ wh... 阅读全文
posted @ 2018-06-20 11:02 花儿为何那样红 阅读(218) 评论(0) 推荐(0)
摘要:/** * 使用链表实现队列 * Create by Administrator * 2018/6/19 0019 * 下午 4:37 **/ public class Link { public long dData; public Link next; public Link(long d){ this.dData = d; } ... 阅读全文
posted @ 2018-06-19 17:18 花儿为何那样红 阅读(199) 评论(0) 推荐(0)
摘要:/** * 使用链表实现队列 * Create by Administrator * 2018/6/19 0019 * 下午 4:37 **/ public class Link { public long dData; public Link next; public Link(long d){ this.dData = d; } ... 阅读全文
posted @ 2018-06-19 16:56 花儿为何那样红 阅读(144) 评论(0) 推荐(0)
摘要:/** * 双端链表操作 * Create by Administrator * 2018/6/14 0014 * 下午 2:05 **/ class Link1 { public long dData; public Link1 next; public Link1(int id) { this.dData = id; } ... 阅读全文
posted @ 2018-06-15 10:14 花儿为何那样红 阅读(118) 评论(0) 推荐(0)
摘要:/** * 单链表操作 * Create by Administrator * 2018/6/14 0014 * 下午 2:05 **/ public class Link { public int iData; public double dData; public Link next; public Link(int id, double dd)... 阅读全文
posted @ 2018-06-14 15:35 花儿为何那样红 阅读(226) 评论(0) 推荐(0)
摘要:运行测试: 请输入: (4+2*3)/2 For ( Stack (bottom-->top): For 4 Stack (bottom-->top): ( For + Stack (bottom-->top): ( For 2 Stack (bottom-->top): ( + For * Sta 阅读全文
posted @ 2018-06-14 12:21 花儿为何那样红 阅读(1719) 评论(0) 推荐(0)
摘要:/** * 队列 * Create by Administrator * 2018/6/11 0011 * 下午 3:27 **/ public class Queue { private int maxSize; private long[] queArray; private int front; //前 private int rear;... 阅读全文
posted @ 2018-06-11 16:33 花儿为何那样红 阅读(208) 评论(0) 推荐(0)
摘要:测试控制台输入字符串:a{b(c]d} 结果:Error:] at 3 阅读全文
posted @ 2018-06-11 15:01 花儿为何那样红 阅读(531) 评论(0) 推荐(0)
摘要:/** * 栈 * Create by Administrator * 2018/6/11 0011 * 上午 10:20 **/ public class StackX { private int maxSixe; private long[] stackArray; private int to 阅读全文
posted @ 2018-06-11 14:11 花儿为何那样红 阅读(222) 评论(0) 推荐(0)
摘要:/** * 数组的曾删改查 * Create by Administrator * 2018/6/8 0008 * 上午 9:54 **/ public class HighArray { private long[] a; private int nElems; public HighArray(int max){ a = new long... 阅读全文
posted @ 2018-06-08 15:05 花儿为何那样红 阅读(284) 评论(0) 推荐(0)
摘要:package test3; public class Sort{ /** * 冒泡排序 * @param array */ public void bubbleSort(int[] array) { for (int i = 1; i array[j + 1]) //判断相邻两个元素的大小 { int c = array[j]; //保存... 阅读全文
posted @ 2017-10-14 14:51 花儿为何那样红 阅读(251) 评论(0) 推荐(0)