From charlesreid1

No edit summary
Line 5: Line 5:
===Implementation notes===
===Implementation notes===


This uses a doubly-linked circular list.  
To implement a double-ended queue with fast, O(1) addition and removal at the front and back of the data structure, use a doubly-linked list.
 
To conserve memory overhead, use a circular doubly-linked list.


===Interface===
===Interface===

Revision as of 06:02, 4 June 2017

LinkedDeque is a class that implements a double ended queue using a linked list data structure.

Code

Implementation notes

To implement a double-ended queue with fast, O(1) addition and removal at the front and back of the data structure, use a doubly-linked list.

To conserve memory overhead, use a circular doubly-linked list.

Interface

(implementation details)

Test

(code for a unit test)

The Class

(code for the class)

Flags