Download the PHP package thomaslarsson/priorityqueue without Composer
On this page you can find all versions of the php package thomaslarsson/priorityqueue. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thomaslarsson/priorityqueue
More information about thomaslarsson/priorityqueue
Files in thomaslarsson/priorityqueue
Package priorityqueue
Short Description Ascending/descending PriorityQueues. Order maintained for nodes with equal priority on dequeue
License MIT
Homepage http://github.com/ThomasLarsson/PriorityQueue
Informations about the package priorityqueue
PriorityQueue
Ascending/descending PriorityQueues. Order maintained for nodes with equal priority on dequeue.
Install
You can install the package using Composer.
- Install composer.
- Add the following dependency to a composer.json and:
The package is now installed in your vendor directory.
Usage
Fixes equal priority sorting bug
ThomasLarsson/PriorityQueue is built on top of SplPriorityQueue. This implementation fixes problems when two or more nodes share a similar priority. The standard SPL-implementation will dequeue equal priority nodes in no particular (random) order, as noted in the manual.
SPLPriorityQueue::compare()
Note: Multiple elements with the same priority will get dequeued in no particular order.