单点时限: 2.0 sec
内存限制: 512 MB
请你实现一个队列,同时你有两个队列的实例对象
YES
表示空,NO
表示非空
注意,如果出现任何非法操作,则输出ERROR
,并 跳过 该操作。
除了operator=
和clear
操作外,其他操作都要求在
利用链表数据结构实现Linked Queue
,自己定义链表节点。
第一行一个整数
接下来的
对于
遇到任意非法的操作则输出ERROR
,并且跳过该操作。
22 pop a push a 1 push a 2 push b 3 front a operator= a front a front b push a 4 front a pop a front a front b pop a front a swap front a front b pop b pop b empty b empty a
ERROR 1 1 1 1 2 1 4 1 4 ERROR YES NO
样例解释:
在经过operator=
操作时,将