|
ADS
Algorithms and Data Structures
|
The DEQUEUE (double ended queue) of exercise 4.9, a sequence changed at both ends, which is a STACK when used at one end and a QUEUE when used at both [see ADT.h]: realized with a LIST with pointers, every operation takes \( O( 1 ) \) time. More...
#include "ADS/Contract.h"#include "ADS/sequence/List.h"#include <cstddef>#include "ADS/queue/impl/Dequeue.tpp"Go to the source code of this file.
Classes | |
| class | ADS::Dequeue< T > |
| a DEQUEUE on a bidirectional list with pointers More... | |
Namespaces | |
| namespace | ADS |
The DEQUEUE (double ended queue) of exercise 4.9, a sequence changed at both ends, which is a STACK when used at one end and a QUEUE when used at both [see ADT.h]: realized with a LIST with pointers, every operation takes \( O( 1 ) \) time.
It is the structure of the algorithm of Pape-D'Esopo (section 11.8).
The contracts [see Contract.h]: removeHead(), removeTail(), head() and tail() need a dequeue that is not empty, and the insertions ensure one that is not. A removal copies the item, which the list reads before it removes its cell. The operations are defined in Dequeue.tpp.