I'm looking for a datastructure (and hopefully a crate) which implements something like a recursive HashMap
- where the key
of the hashmap can either contain a value
, or contain another key
, to be considered as it's ancestor. The root key
has no ancestor. All keys must have a singe ancestor, so the keys form a tree like structure.
A search for key
would be recursive till we find a value, or return a None.
I've working on a naive implementation wrapping indextree (for recursive key lookup) and HashMap (for value lookup) into a utility class.
Please let me know if you can suggest anything. My background is not in computer science, so apologies if this is not clear.
thanks!