BucketQueue

Circular Bucket Queue.

Returns input'd points in sorted order. All operations run in roughly O(1) time (for input with small cost values), but it has a strict requirement:

If the most recent point had a cost of c, any points added should have a cost c' in the range c <= c' <= c + (capacity - 1).