双端队列的两种实现方式零,前言CS61B第三周的Project1A:
内容是实现Deque这种双向链表数据结构,底层的实现方式分别是基于内存不连续的链表和内存连续的数组
作业链接
一,基于链表的Deque:LinkedListDeque实现要求
public void addFirst(T item): Adds an item of type T to the front of the deque.
public void addLast(T item): Adds an item of type T to the back of the deque.
public boolean isEmpty(): Returns true if deque is empty, false otherwise.
public int size(): Returns the number of items in the deque.
public void printDeque(): Prints the items in the deque from first to last, sep