随笔分类 - 数据结构和算法
摘要:package thread1; /** * 实现一个简单的ArrayList * * @Title: uminton */ public class SimpleArrayList { //数组中元素的大小 private Integer elementSize = 0; //创建SimpleArrayList时,数组的容量,默认为16 privat...
阅读全文
摘要:/** * 高级排序,希尔排序 * Create by Administrator * 2018/7/2 0002 * 下午 4:20 **/ class ArraySh{ private long[] theArray; private int nElems; public ArraySh(int max){ theArray = new ...
阅读全文
摘要:/** * 并归排序 * Create by Administrator * 2018/6/26 0026 * 下午 5:13 **/ public class DArray { private long[] theArray; private int nElens; public DArray(int max){ theArray = ...
阅读全文
摘要:/** * 合并两个数组并排序 * 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){ ...
阅读全文
摘要:/** * 递归实现二分查找法 * 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...
阅读全文
摘要:/** * 递归 * Create by Administrator * 2018/6/20 0020 * 上午 9:41 **/ public class TriangleApp { static int theNumber; public static void main(String[] args) throws IOException{ wh...
阅读全文
摘要:/** * 使用链表实现队列 * 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; } ...
阅读全文
摘要:/** * 使用链表实现队列 * 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; } ...
阅读全文
摘要:/** * 双端链表操作 * Create by Administrator * 2018/6/14 0014 * 下午 2:05 **/ class Link1 { public long dData; public Link1 next; public Link1(int id) { this.dData = id; } ...
阅读全文
摘要:/** * 单链表操作 * 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)...
阅读全文
摘要:运行测试: 请输入: (4+2*3)/2 For ( Stack (bottom-->top): For 4 Stack (bottom-->top): ( For + Stack (bottom-->top): ( For 2 Stack (bottom-->top): ( + For * Sta
阅读全文
摘要:/** * 队列 * Create by Administrator * 2018/6/11 0011 * 下午 3:27 **/ public class Queue { private int maxSize; private long[] queArray; private int front; //前 private int rear;...
阅读全文
摘要:测试控制台输入字符串:a{b(c]d} 结果:Error:] at 3
阅读全文
摘要:/** * 栈 * Create by Administrator * 2018/6/11 0011 * 上午 10:20 **/ public class StackX { private int maxSixe; private long[] stackArray; private int to
阅读全文
摘要:/** * 数组的曾删改查 * 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...
阅读全文
摘要:package test3; public class Sort{ /** * 冒泡排序 * @param array */ public void bubbleSort(int[] array) { for (int i = 1; i array[j + 1]) //判断相邻两个元素的大小 { int c = array[j]; //保存...
阅读全文

浙公网安备 33010602011771号