【有没有高手会这道编程题啊!!!急啊,在线等!!!】

来源:百度知道 编辑:UC知道 时间:2024/05/25 16:44:51
随便用什么语言编出来都行,马上就要用了,感激不尽啦!!!

A deque is a data structure consisting of a list of items,on which the following operations are possible:
Push(X,D):Insert item X on the front end of the deque D.
Pop(D):Remove the front item from deque D and return it.
Inject(X,D):Insert item X on the rear end of deque D.
Eject(D):Remove the rear item from deque D and return it.
Write routines to support the deque that take O(1) time per operation.
我是要编出程序啊,希望各位大虾帮一下啦,我的分数已经倾囊而出了!!!
翻译:双端队列(deque)是由一些项的表组成的数据结构,对该数据结构可以进行下列操作:
push(D,X) 将项X 插入到双端队列D的前端
pop(D) 从双端队列D中删除前端项并将其返回
inject(D,X) 将项X插入到双端队列D的尾端
eject(D) 从双端队列D中删除尾端项并将其返回
编写支持双端队伍的例程,每种操作均花费O(1)时间

直接看不懂

me.too

貌似题目什么意思都不知道

你是让翻译还是编程啊

1 deque是一个数据结构,一个项目清单,对其中以下行动都是可能的:
推(第十四) :插入项目X在前端的deque四
流行(四) :在移除前项目从deque D和退货。
注(第十四) :插入项目X在后方年底deque四
喷射(四) :消除后方项目从deque D和退货。
写例程支持deque考虑O ( 1 )的时间,每运行。
如果你没弄错,我就怎么翻译的