Constructor
new BucketQueue(bits, cost_functor)
Parameters:
Name | Type | Description |
---|---|---|
bits | number | Number of bits. |
cost_functor | function | The cost functor. |
- Source
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).
Name | Type | Description |
---|---|---|
bits | number | Number of bits. |
cost_functor | function | The cost functor. |