i wondering in cases use multimap rather map of sets.
say have bunch of tuples consist of <[0-9],[0-9]+>. so, have 0-9 on left , 0 - unlimited on right.
i make map , have left side of tuples key. value set of right sides of tuples have same left side. way have log(10) lookup time left , in case of unordered set “hash-time” lookup time right side. don't know how multimaps work internally... so, assuming put right sides in vector , binary search on worse hash-tiem lookup (provided has function)... don’t know how work. so, in cases this, better choice? takes less time, uses less memory?
and know has been asked example here: multimap vs map set
but question more specific, left side of tuples restricted in variance , answers in thread contain lot of guessing implementation of multimaps.
edit
so go numbers example have <2, 928947>. need strings though, store grammar parser, needs lookup rules left hand side.
Comments
Post a Comment