Boost logo

Boost Users :

Subject: Re: [Boost-users] Question on data structure usage
From: Sebastian Messerschmidt (sebastian.messerschmidt_at_[hidden])
Date: 2016-11-29 04:27:57


Hi Ram,

If you're looking for something like autocompletion "Tries" might be
more suited than maps/multimaps:

https://en.wikipedia.org/wiki/Trie

Cheers
Sebastian

> Hi,
>
> I have a map as follows,
>
> boost::unordered_map<string, string> sample_map;
>
> I would like to look up the keys using wildcards/regex from the user and
> get the values corresponding to it(get multiple matches). It looked like
> there is no straightforward way to do it.
>
> So, I was thinking as an when I populate the map, I create a seperate
> data structure to store the keys, so that I can get the values(list)
> that match my user inputted regex/wildcard search. The I use this list
> to get the values from the map.
>
> What data structure can I use for this purpose? Is my approach correct?
> Or can I do this directly using the map?
>
> Please help me solve this problem.
>
> Thanks,
> -R
>
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net