Offer09.用两个栈实现队列/CQueue.java
import java.util.LinkedList;

class CQueue {

    LinkedList<Integer> inStack, outStack;

    public CQueue() {
        inStack = new LinkedList<>();
        outStack = new LinkedList<>();
    }

    public void appendTail(int value) {
        inStack.add(value);
    }

    public int deleteHead() {
        if (!outStack.isEmpty()) {
            return outStack.removeLast();
        } else if (inStack.isEmpty()) {
            return -1;
        }

        while (!inStack.isEmpty()) {
            outStack.addLast(inStack.removeLast());
        }

        return outStack.removeLast();
    }
}

/**
 * Your CQueue object will be instantiated and called as such:
 * CQueue obj = new CQueue();
 * obj.appendTail(value);
 * int param_2 = obj.deleteHead();
 */