Scaffold crate to manage data structures
This commit is contained in:
parent
e51655f6e4
commit
28e780d274
4 changed files with 56 additions and 0 deletions
13
src/backing/pure/mod.rs
Normal file
13
src/backing/pure/mod.rs
Normal file
|
@ -0,0 +1,13 @@
|
|||
/// Data structures for the "pure" min-queues, supporting duplicates but no arbitrary updates
|
||||
|
||||
/// A data structure usable for backing a "pure" queue
|
||||
pub trait PureBacking<T: Ord> {
|
||||
/// Instantiates a new data structure
|
||||
fn new() -> Self;
|
||||
/// Places an item into the queue
|
||||
fn add(&mut self, item: T);
|
||||
/// Removes the item with minimum priority, if it exists
|
||||
fn pop(&mut self) -> Option<T>;
|
||||
/// The number of items in the queue
|
||||
fn len(&self) -> usize;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue