Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 List ADT 来实现课程中讨论的 Queue ADT。在实现此队列时,您应该仅将 List ADT 用作 ADT 的用户。不要使用任何数组或链表来实现此队列。您需要实现以下方法:enqueue、serve和。lengthfull
enqueue
serve
length
full
如果不是链表,我不明白什么是列表?什么是 ADT 用户?
LinkedList是接口的实现之一List,比如ArrayListorArrayQueue并且它已经实现了Queue,所以它被排除在要求之外。但是您可以List在您的实现中使用扩展或聚合的任何其他Queue实现。
LinkedList
List
ArrayList
ArrayQueue
Queue