LeetCode 232. Implement Queue using Stacks (Java)
Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty).
Implement the MyQueue class:
void push(int x) Pushes element x to the back of the queu
原创
2020-12-04 17:31:29 ·
242 阅读 ·
0 评论