--- 栈相关 --- #### [09. 用两个栈实现队列](https://leetcode-cn.com/problems/yong-liang-ge-zhan-shi-xian-dui-lie-lcof/) ```java class CQueue { Stack putStack, takeStack; public CQueue() { putStack = new Stack<>(); takeStack = new Stack<>(); } public void appendTail(int value) { putStack.push(value); } public int deleteHead() { if (takeStack.isEmpty()) { while (!putStack.isEmpty()) { takeStack.push(putStack.pop()); } } if (takeStack.isEmpty()) { return -1; } else { return takeStack.pop(); } } } ```