剑指offer----用两个队列实现一个栈(java代码)

最近在看《剑指offer》,看到书上“用两个队列实现一个栈”的题目,书上只有思想,没有具体的代码,就本身动手写了下,在此分享出来,很少说,看代码。node private static class StackSelf<T> { Queue<T> queue1 = new LinkedList<>(); Queue<T> queue2 = new LinkedList
相关文章
相关标签/搜索