zoukankan      html  css  js  c++  java
  • 队列课下作业

    队列课下作业


    一、补充书上代码15.5

    public T dequeue() throws EmptyCollectionException {
            if (isEmpty()) throw new EmptyCollectionException("queue");
            T result = front.getElement();
            front = front.getNext();
            count--;
            if (isEmpty()) rear = null;
            return result;
        }
    
        public T first() throws EmptyCollectionException {
            if (isEmpty()) throw new EmptyCollectionException("queue");
            return front.getElement();
        }
    
        public boolean isEmpty() {
            return (count == 0);
        }
    
        public int size() {
            return count;
        }
    
        public String toString() {
            String result = "";
            LinearNode<T> current = front;
            while (current != null) {
                result = result + (current.getElement()).toString() + "
    ";
                current = current.getNext();
            }
            return result;
        }
    

    二、单步跟踪排队情况

  • 相关阅读:
    dubbo springcloud区别
    rpc
    centos7 安装docker
    vibox安装
    知识点
    spring cloud
    微服务设计原则
    工具类
    xss--知识点
    java基础--注解
  • 原文地址:https://www.cnblogs.com/zhanghaolin/p/7674876.html
Copyright © 2011-2022 走看看