【有没有高手会这道编程题啊!!!急啊,在线等!!!】
随便用什么语言编出来都行,马上就要用了,感激不尽啦!!! 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)时间
[[it] 本帖最后由 koma100 于 2008-4-9 17:18 编辑 [/it]]