ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
UniqueQueue.h

A QUEUE with no duplicates, beyond the book, with one of two policies for an item that is already in the queue. More...

Files

file  ADS/queue/UniqueQueue.h
 A QUEUE [see ADT.h] with no duplicates, beyond the book, with one of two policies for an item that is already in the queue: IGNORE_NEW does not enqueue it again, FORGET_OLD removes the old copy and enqueues the item at the back.

Classes

class  ADS::UniqueQueue< T, D >
 a QUEUE with no duplicates; the equality of T must be an equivalence, so an item unequal to itself (e.g., a NaN) cannot be enqueued: the postcondition of enqueue() refuses it More...

Enumerations

enum class  ADS::Duplicate { ADS::Duplicate::IGNORE_NEW , ADS::Duplicate::FORGET_OLD }
 what enqueue() does with an item already in the queue More...

Detailed description

A QUEUE with no duplicates, beyond the book, with one of two policies for an item that is already in the queue.

The definitions, the invariants and the costs of the area are in Theory of queues.

Enumeration type documentation

◆ Duplicate

enum class ADS::Duplicate
strong

what enqueue() does with an item already in the queue

Enumerator
IGNORE_NEW 

the queue is left as it is

FORGET_OLD 

the old copy is removed, the item goes to the back