摘要:
class Queue<T>{ private int size = 0; private int length; private final int default_length = 20; private Object[] o; public Queue(){ length = default_length; o = new Object[length]; } public Queue(T data,int init_length){ length = init_length; o = new Object[length]; o[size] = data; size++; .. 阅读全文
摘要:
class Stack<T>{ private int size=0;//栈大小 private final int default_length=20; private int length;//栈容量 private Object[] o; //初始化 public Stack(){ length = default_length; o = new Object[length]; } public Stack(T data,int init_length){ length = init_length; o = new Object[length]; o[0] = data; . 阅读全文
摘要:
class LinkList<T>{ private class Node{ private T data; private Node next; public Node(T data,Node next){ this.data = data; this.next = next; } } private int length=0; //链表长度 private Node head; private Node tail; public LinkList(){ head=null; tail=null; } public LinkList(T data){ head = n... 阅读全文
摘要:
源码:class SequenceList<T>{ private int size=0;//表大小 private int max_length;//表长 private final int default_length = 20;//默认长度 private Object[] o; //初始化 public SequenceList(){ max_length = default_length; o = new Object[max_length]; } public SequenceList(int init_length,T data){ max_length = init 阅读全文