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

The random queue of exercise 2.2 of Morin's book, beyond the book. More...

Files

file  ADS/queue/RandomQueue.h
 The random queue of exercise 2.2 of Morin's book, beyond the book: a bag in which push() puts an item and pop() takes one out chosen uniformly at random among those inside, both in \( O( 1 ) \) amortized time.

Classes

class  ADS::RandomQueue< T >
 a bag from which pop() takes an item uniformly at random More...

Detailed description

The random queue of exercise 2.2 of Morin's book, beyond the book.

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