Module sui::priority_queue
Priority queue implemented using a max heap.
use std::vector;
Struct PriorityQueue
Struct representing a priority queue. The entries vector represents a max heap structure, where entries[0] is the root, entries[1] and entries[2] are the left child and right child of the root, etc. More generally, the children of entries[i] are at i * 2 + 1 and i * 2 + 2. The max heap should have the invariant that the parent node's priority is always higher than its child nodes' priorities.
public struct PriorityQueue<T: drop> has drop, store
Click to open
Fields
- entries: vector<sui::priority_queue::Entry<T>>