数据结构(第四章栈和队列).pptVIP

  • 116
  • 0
  • 约2.83万字
  • 约 134页
  • 2019-07-08 发布于江苏
  • 举报
4.2 队列 队列应用 //【例4.3】 求解素数环问题。 public class PrimeRing { public PrimeRing(int max) //求1~max素数环 { SortedSeqListInteger primeset = createPrime(max);//排序顺序表存储素数集合 System.out.println(素数集合: +primeset.toString()); SeqListInteger ring = new SeqListInteger(max); //顺序表,存储素数环 ring.insert(1); //素数环添加Integer(1) QueueInteger que = new SeqQueueInteger(max); //创建空队列,链式队列也可 // QueueInteger que = new LinkedQueueInteger(); //创建空队列 for (int i=2; i=max; i++)

文档评论(0)

1亿VIP精品文档

相关文档