-
Notifications
You must be signed in to change notification settings - Fork 111
Open
Labels
enhancementNew feature or requestNew feature or request
Description
In a few places, we need to map between a set of items and the indices [0..num_items]
example 1, also the DKG / Reshare.
We do this with an ad-hoc abstraction in each case, but it would be useful to have a little abstraction in utils
for this.
A simple way to do this would be to have the backing type contain a sorted vec of elements. You could easily create this from a slice or iterator, by collecting the elements, sorting them, and then removing duplicates. You could map an index to an item in O(1), by just indexing into the vector, and you could figure the index of an item with a binary search.
BrendanChoupatrick-ogrady
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Backlog