Scaffold crate to manage data structures

This commit is contained in:
Michael Bradley 2025-01-04 00:13:17 +13:00
parent e51655f6e4
commit 28e780d274
Signed by: MichaelBradley
SSH key fingerprint: SHA256:cj/YZ5VT+QOKncqSkx+ibKTIn0Obg7OIzwzl9BL8EO8
4 changed files with 56 additions and 0 deletions

13
src/backing/pure/mod.rs Normal file
View 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;
}