classMyStack{publicstaticStack<Character> st =newStack<Character>();publicvoidpushC(char c){st.push(c);}publiccharpopC(){char ret = st.pop();return ret;}}
队列
classMyQueue{publicstaticQueue<Character> que =newLinkedList<>();publicvoidenqueueC(char c){que.offer(c);}publicchardequeueC(){char ret = que.poll();return ret;}}