Implementation of map using key sorted linked list.
let mut some_map: Map<u64, Field, 12> = Map::default();
some_map.insert(76, 2098);
some_map.insert(12, 527);
assert(some_map.len == 2);
let value = some_map.remove(76);
assert(value.is_some());
assert(value.unwrap() == 2098);
Inserts a key, value pair in
Removes a key, value pair in
Returns the number of entries in the map.
Checks if the map is empty.
Checks if the given key exists in the map.
Returns the value of the corresponding key.
Returns the item of the corrsponding key.
Returns all the keys in the map.
Returns all the values in the map.
Creates an instance of the map.
This is measured after 3 insertions.
Methods | Number of Gates |
---|---|
insert | 46151 |
remove | 47995 |
get | 5234 |
Methods | Number of Gates |
---|---|
insert | 7998 (5.77x) |
removal | 16302 (2.94x) |
get | 4085 (1.28x) |