public class PriorityQ { private int maxSize; private long[] queArray; private int nItems; //constructor public PriorityQ(int s){ maxSize = s; queArray = new long[maxSize]; nItems = 0; } //insert public void insert(long item){ int j; ... Read More
posted @ 2013-01-26 15:50 tangrongyue Views(1923) Comments(0) Diggs(0) Edit
public class Queue { private int maxSize;//数组大小 private long[] queArray; private int front;//队头 private int rear;//队尾 private int nItems;//数据项个数 //create Queue public Queue(int s){ maxSize = s; queArray = new long[s]; front = 0; rear = -1; ... Read More
posted @ 2013-01-26 12:10 tangrongyue Views(3480) Comments(0) Diggs(0) Edit
public class StackX { private int maxSize; private char[] stackArray; private int top; //栈构造方法 public StackX(int max){ stackArray = new char[max]; top = -1; maxSize = max; } //入栈 public void push(char ch){ stackArray[++top] = ch;//top先自增1在执... Read More
posted @ 2013-01-26 10:02 tangrongyue Views(323) Comments(0) Diggs(0) Edit