leetcodepushfront stack w 2 queues stack w 2 queues
leetcode推前stack_w_2_queues力码编队/* Q. Implement the following operations of a stack using queues: - push(x): Push element x onto stack. - pop(): Removes the element on top of the stack. - top(): Get the top element. - empty(): Return whether the stack is empty. Note: - You must use only standard operations of a queue, which means only push to back, peek/pop from front, size, and is empty operations are valid. - Depending on your language, queue may not be supported natively. - You may simulate
用户评论