Priority Queue
An implemantation of priority queue. Based on the book named Advanced Algorithms and Data Structures.
Usage
To use this crate, simply add the following string to your Cargo.toml
:
quotient-filter = "0.1.0"
// Parameters are capacity and branching factor(default 4).
// It's a vector of pairs behind the scenes, so defined capacity is a good idea.
let mut queue = new;
// The second parameter is the priority
queue.insert_value
// Get the highest priority value
let top = queue.top;
// There is also peek which doesn't take the value out of the queue
let peek = queue.peek;
// Check if queue contains
let is_exists = queue.contains;
// Remove
let old_task = queue.remove;
// Update its priority
queue.update_priority;