|
ADS
Algorithms and Data Structures
|
The QUEUE with the minimum of exercise 3.15 of Morin's book, beyond the book. More...
Files | |
| file | ADS/queue/MinQueue.h |
| The QUEUE with the minimum of exercise 3.15 of Morin's book, beyond the book [see ADT.h]: enqueue(), dequeue(), top(), size() and min(), all in \( O( 1 ) \) amortized time, on two stacks with the minimum [see MinStack.h]: the items enter the stack \( I \) and leave from the stack \( O \), which, when empty, takes all the items of \( I \) in the reverse order, the front on top. | |
Classes | |
| class | ADS::MinQueue< T, C > |
| a QUEUE with its least item in \( O( 1 ) \) amortized time More... | |
The QUEUE with the minimum of exercise 3.15 of Morin's book, beyond the book.
The definitions, the invariants and the costs of the area are in Theory of queues.