Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mageshsankar/nstack

 
 

Repository files navigation

nstack

nstack is a stack-like merkle datastructure for storing and accessing indexed values.

Operations supported are add and remove at the end of the structure, and mutable access to indexed leaves.

Usage example

use kelvin::{annotations::Cardinality, Blake2b};

let n: usize = 256;
let mut nt = NStack::<_, Cardinality<u64>, Blake2b>::new();

for i in 0..n {
    nt.push(i).unwrap();
}

// get a mutable reference to the 128'th element

let element = &mut *nt.get_mut(128).unwrap().unwrap();

About

Stack data structure

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%