/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ctdl;

/**
 *
 * @author HD ♥ HT
 */
public class QueueDemo {
    
}

@@ -264,13 +264,2114 @@
  %7B%0D%0A    
+int%5B%5D arr = new int%5B100%5D;%0D%0A    private int f = 0;%0D%0A    private int r = f;%0D%0A    private int size = r-f;%0D%0A    %0D%0A       %0D%0A    %0D%0A    //test Empty queue%0D%0A    public boolean isEmpty()%7B%0D%0A        if((f%3C0)%7C%7C(f%3E=r))%0D%0A            return true;%0D%0A        return false;%0D%0A    %7D%0D%0A    %0D%0A    //test Full Queue%0D%0A    public boolean isFull()%7B%0D%0A        return size == arr.length;%0D%0A    %7D%0D%0A    %0D%0A    //enqueue%0D%0A    public void enQueue(int node)%7B%0D%0A        if(isFull())%7B%0D%0A            throw new ArrayIndexOutOfBoundsException(%22 Full Queue!%22);%0D%0A        %7D%0D%0A        else%7B%0D%0A            arr%5Br%5D = node;%0D%0A            r = r+1;%0D%0A            size++;%0D%0A        %7D%0D%0A    %7D%0D%0A    %0D%0A    //dequeue%0D%0A    public void deQueue()%7B%0D%0A        if(isEmpty()) %7B%0D%0A            throw new ArrayIndexOutOfBoundsException(%22Empty Queue!%22);%0D%0A            %0D%0A        %7Delse%7B%0D%0A            f =f+1;%0D%0A            size--;%0D%0A        %7D%0D%0A    %7D%0D%0A    %0D%0A    //peek Queue%0D%0A    %0D%0A    public int peek()%7B%0D%0A        return arr%5Bf%5D;%0D%0A    %7D%0D%0A    %0D%0A    //d%C3%ADplay%0D%0A    public void display()%7B%0D%0A        if(isEmpty())%7B%0D%0A            System.out.println(%22Queue is Empty!%22);%0D%0A        %7Delse%7B%0D%0A            for(int i = f; i%3Cr; i++)%7B%0D%0A            System.out.println(arr%5Bi%5D);%0D%0A        %7D%0D%0A        %7D%0D%0A        %0D%0A    %7D%0D%0A    %0D%0A    %0D%0A    public static void main(String%5B%5D args) %7B%0D%0A        QueueDemo que = new QueueDemo();%0D%0A        System.out.println(que.arr.length);%0D%0A        System.out.println(%22-------------------%22);%0D%0A        %0D%0A        //enqueue%0D%0A//        que.enQueue(5);%0D%0A//        que.enQueue(6);%0D%0A//        que.enQueue(7);%0D%0A        %0D%0A        //display%0D%0A        //que.display();%0D%0A        %0D%0A        //dequeue%0D%0A//        System.out.println(%22-------------------%22);%0D%0A//        que.deQueue();%0D%0A//        que.display();%0D%0A        %0D%0A        //test the Empty Queue%0D%0A        System.out.println(%22-------------------%22);%0D%0A        System.out.println(%22Is Queue Empty?%22);%0D%0A        System.out.println(que.isEmpty());%0D%0A        %0D%0A        %0D%0A        //test the Full Queue%0D%0A        System.out.println(%22-------------------%22);%0D%0A        System.out.println(%22Is Queue Full?%22);%0D%0A        System.out.println(que.isFull());%0D%0A        %0D%0A    %7D
 %0D%0A%7D%0D%0A

Update QueueDemo.java