![](https://img-blog.csdnimg.cn/20190918140213434.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
数据结构和算法
数据结构、算法
CrazyL-
记录学习点点滴滴,一次共勉
展开
-
java数组
public class ArrayUtil { private long[] a;//ref to array a private int nElems;//number of data items public ArrayUtil(int max){ a = new long[max]; nElems = 0; } //fi原创 2016-07-25 16:44:14 · 338 阅读 · 0 评论 -
java递归
程序设计中的数学归纳法 每一个递归都有一个基值(终止)条件 ,以防止无限的递归下去 三角数字:1,3,6,10,15,21,28,。。。。。import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class TiangleApp { stat原创 2016-08-08 14:48:50 · 308 阅读 · 0 评论 -
java双向链表
既允许向前遍历也允许向后遍历整个链表 public class Link { public long dData; public Link next; public Link previous; public Link(long d){ dData=d; } public void displayLink(){ Syste原创 2016-08-08 14:33:31 · 459 阅读 · 0 评论 -
java有序链表
public class Link { public long dData;//date item public Link next; public Link(long dd){ dData = dd; } public void displayLink(){ System.out.print( dData + " ");原创 2016-08-08 14:07:14 · 1710 阅读 · 0 评论 -
java双端链表
双端链表新增特性:对最后一个链表的引用,就像对第一个链接点的引用一样。像表头一样访问表尾 public class Link { public long dData;//date item public Link next; public Link(long dd){ dData = dd; } public void displayLink(原创 2016-08-08 13:54:14 · 863 阅读 · 0 评论 -
java单链表
单链表操作: 在链表头插入一个数据项 在链表头删除一个数据项 遍历链表显示他的内容 public class Link { public int iData; //data item key public double dData;//date item public Link next; public Link(int id,double dd){原创 2016-08-08 10:55:11 · 502 阅读 · 0 评论 -
java优先级队列
public class PriorityQ { private int maxSize; private long[] queArray; private int nItems; public PriorityQ(int s){ maxSize = s; queArray = new long[s]; nItems =原创 2016-08-08 09:04:45 · 446 阅读 · 0 评论 -
java队列
public class Queue { private int maxSize; private long[] queArray; private int front; private int rear; private int nItems; public Queue(int s){ maxSize = s; queA原创 2016-08-05 14:31:30 · 263 阅读 · 0 评论 -
java栈
栈只允许访问一个数据项,即最后插入的数据项。移除这个数据项才能访问倒数第二个插入的数据项。原创 2016-08-04 09:18:00 · 392 阅读 · 0 评论 -
java插入排序
public class ArrayIns { private long[] a; private int nElems; public ArrayIns(int max){ a = new long[max]; nElems = 0; } public void insert(long value){ a[nE原创 2016-08-04 08:42:45 · 339 阅读 · 0 评论 -
java选择排序
public class ArraySel { private long[] a; private int nElems; public ArraySel(int max){ a = new long[max]; nElems = 0; } public void insert(long value){ a[nE原创 2016-08-03 14:12:12 · 326 阅读 · 0 评论 -
java冒泡排序
public class ArrayBub { private long[] a; private int nElems; public ArrayBub(int max){ a = new long[max]; nElems=0; } public void insert(long value){ a[nEle原创 2016-07-25 17:32:18 · 306 阅读 · 0 评论 -
java有序数组
public class SortArray { private long[] a;//ref to array a private int nElems;//number of data items public SortArray(int max){ a = new long[max]; nElems = 0; } publ原创 2016-07-25 17:07:45 · 2776 阅读 · 0 评论 -
java希尔排序
public class Main { public static void main(String [] args) { int[]a={49,38,65,97,76,13,27,49,78,34,12,64,1}; System.out.println("排序之前:"); for(int i=0;i<a.length;i++)原创 2016-08-26 11:41:53 · 306 阅读 · 0 评论