• jQuery火箭图标返回顶部代码


    
    public class ArrayQueue
    {
        private static final String TAG = "ArrayQueue";
        private Object[] queue;
        private int SIZE = 10;//初始化大小
        private int front = 0;
        private int rear = 0;
        private int usesize = 0;
    
        public ArrayQueue()
        {
            queue = new Object[SIZE];
        }
    
        public boolean isEmpty()
        {
            return (rear - front) == 0;
        }
    
        public int getSize()
        {
            return rear - front;
        }
    
        public void insert(Object obj) throws Exception
        {
            if (front > rear || rear > SIZE) throw new Exception("无法进入队列!");
            if (((rear - front) + 1) % SIZE == 0) throw new Exception("队列已满!");
            queue[rear] = obj;
            rear++;
            usesize++;
        }
    
        public void delete() throws Exception
        {
            if (front >= rear || rear > SIZE) throw new Exception("无法删除!");
            queue[front] = null;
            front++;
            usesize--;
        }
    
        public void display() throws Exception
        {
            if (usesize == 0) throw new Exception("空队列!");
            for (int i = front; i < rear; i++)
            {
                System.out.print(queue[i] + "<-");
            }
            System.out.println("");
        }
    
        public static void main(String[] args) throws Exception
        {
            ArrayQueue aq = new ArrayQueue();
            aq.insert("123");
            aq.insert("qwe");
            aq.insert("tt");
            aq.insert("h8h0-----=1ew");
            System.out.println(aq.queue[0]);
            System.out.println(aq.queue[1]);
            System.out.println(aq.queue[2]);
            System.out.println(aq.queue[3]);
            System.out.println(aq.getSize());
            aq.display();
        }
    
    
    } 
  • 相关阅读:
    etcd扩展使用
    etcd注册服务
    net core微服务构建方案
    一个简化的插件框架c#
    NSQ消息队列
    c#一些处理解决方案(组件,库)
    c#网络传输
    c#的传输组件dotnetty
    c#网络加密传输
    C++ Boost在Windows和Linux下的编译安装
  • 原文地址:https://www.cnblogs.com/prayjourney/p/12528107.html
Copyright © 2020-2023  润新知