sequence list
http://blog.csdn.net/baoyiming1991/article/details/6265743
public class SqList<E> { private static int INITSIZE=5; private static int INCREASESIZE = 2; private Object[] data = null; private int length; private int listsize; public SqList() { data = new Object[INITSIZE]; length = 0; listsize = INITSIZE; } public boolean AddElement(E e) { if(length == listsize) { Object[] newdata = new Object[listsize+INCREASESIZE]; for (int i=0;i<length;i++) { newdata[i] = data[i]; } listsize = listsize+INCREASESIZE; data = newdata; } data[length] = e; length++; return true; } public E get(int index) { if (index <1 || index > length) return null; return (E) data[index-1]; } public boolean set(int index, E e) { if(index <1 || index > length) return false; data[index-1] = e; return true; } public boolean insert(int index, E e) { if (index <1 || index >length+1) return false; if (e==null) return false; if (length == listsize) { } for (int i=length-1; i>=index-1;i--) { data[i+1] = data[i]; } data[index-1] = e; return true; } public boolean delete(int index) { if(index<1 || index > this.length) { return false; } for (int i=index; i<this.length; i++) { data[i-1] = data[i]; } this.length--; return true; } }
Link List http://blog.csdn.net/baoyiming1991/article/details/6266147
public class LinkList<E> { public LLNode<E> head; public LinkList() { head = new LLNode<E>(); head.next = null; } public boolean add(E e) { LLNode<E> cursor = head; while (cursor.next!=null) { cursor = cursor.next; } LLNode<E> newnode = new LLNode<E>(); newnode.data = e; newnode.next = null; cursor.next = newnode; return true; } public boolean insert(int index, E e) { if (e==null) return false; LLNode<E> cursor = head; int count = 1; while (count < index && cursor!=null) { count++; cursor = cursor.next; } if(count == index && cursor !=null) { LLNode<E> newnode = new LLNode<E>(); newnode.data = e; LLNode<E> temp = cursor.next; cursor.next = newnode; newnode.next = temp; return true; } return false; } public E get(int index) { if(index<1) return null; LLNode<E> cursor = head.next; int count = 1; while (count < index && cursor !=null) { count++; cursor=cursor.next; } if (count == index && cursor !=null) { return cursor.data; } return null; } public boolean delete(int index) { if(index<1) return false; int count =1; LLNode<E> cursor = head; while (count<index && cursor.next !=null) { count ++; cursor = cursor.next; } if (count == index && cursor.next !=null) { return true; } return false; } } class LLNode<E> { public E data; public LLNode<E> next; }
stack and queue http://blog.csdn.net/baoyiming1991/article/details/6266339
相关推荐
JAVA版数据结构[归类].pdf
Java版数据结构
java版数据结构-树结构;java版数据结构-树结构;java版数据结构-树结构;java版数据结构-树结构;java版数据结构-树结构;java版数据结构-树结构;
Java版数据结构,清晰版 数据结构和算法有什么作用、数据结构的好处、算法的概述、面向对象编程
一本本人尽心收集的一本java版数据结构非常经典,非常值得大家收藏和阅读,我相信对你是一个质的飞跃。
java版的数据结构代码,这些经典代码很适合初学者!
java版数据结构与算法,使用java实现一些数据结构。如:各种排序
JAVA版数据结构.pdf
java 版数据结构(全英文) Data Structures & Algorithms in Java by Robert Lafore ISBN: 1571690956 Sams © 1998, 617 pages
java版的数据结构,一些经典的算法,很适合初学者!
java版数据结构 很好很强大 java版数据结构 很好很强大
Java数据结构和算法第七讲.avi Java数据结构和算法第三十一讲.avi Java数据结构和算法第三十七讲.avi Java数据结构和算法第三十三讲.avi Java数据结构和算法第三十九讲.avi Java数据结构和算法第三十二讲.avi Java...
java版数据结构,是学习java编程人员必备的知识点。
java版数据结构与算法分析第二版 包括书中源码和课后练习参考答案。英文版
该资源包含使用Java实现的绝大部分基础算法和数据结构,包含视频教程,使得算法学习更加容易,该资源从网络收集回来,仅供学习使用
java版数据结构和算法java版数据结构和算法java版数据结构和算法java版数据结构和算法java版数据结构和算法java版数据结构和算法java版数据结构和算法java版数据结构和算法java版数据结构和算法
JAVA版数据结构与算法(JAVA语言版解密)。。。。。。。
java版本数据结构与算法CHM格式 数据结构和算法的配套java书籍,英文版
Java版数据结构高清带完整目录,可以直接下载,目前本人一直在用