@@ -0,0 +1,1437 @@
+/*%0A * Copyright 2017 haeun kim%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage datastructure.queue;%0A%0A/**%0A * Created by haeun on 2017-10-16%0A */%0Apublic class ArrayQueue implements Queue%3CString%3E %7B%0A    String%5B%5D items = new String%5B10000%5D;%0A    int rear = -1;%0A    int front = -1;%0A%0A    @Override%0A    public void enqueue(String item) %7B%0A        items%5B++rear%5D = item;%0A    %7D%0A%0A    @Override%0A    public String peek() %7B%0A        if (isEmpty()) return null;%0A%0A        return items%5Bfront + 1%5D;%0A    %7D%0A%0A    @Override%0A    public String dequeue() %7B%0A        if (isEmpty()) return null;%0A%0A        return items%5B++front%5D;%0A    %7D%0A%0A    @Override%0A    public boolean isFull() %7B%0A        if (rear==10000) return true;%0A%0A        return false;%0A    %7D%0A%0A    @Override%0A    public int size() %7B%0A        return (rear - front);%0A    %7D%0A%0A    @Override%0A    public boolean isEmpty() %7B%0A        if (rear == front) return true;%0A        %0A        return false;%0A    %7D%0A%7D%0A

Implement Queue by ArrayQueue