Questions tagged [multimap]

A container similar to a map but allowing duplicate keys

Use this tag for questions about associative arrays with non-unique keys, such as the std::multimap container in the C++ standard library, or scala.collection.mutable.MultiMap in Scala.

See the Wikipedia article for more information.

773 questions
0
votes
1 answer

creating Trigrams using LinkedHashMap java

I am trying to create a trigram model using LinkedHashMap> where Entry is the entry of last inputed bigram (whose structure is: LinkedHashMap Now the problem is, being a map it does not store multiple keys (overwrites the existing key-value pair…
mag443
  • 191
  • 1
  • 4
  • 12
0
votes
4 answers

C++ Multimap manipulation

I have created a multimap as I have repeating keys. But I want do an efficient manipulation so that I can generate a new multimap with subsequent higher keys aligned. This is what I mean: This is what I have: key values 11 qwer 11 …
Zanam
  • 4,607
  • 13
  • 67
  • 143
0
votes
1 answer

issues interator through map.equal_range

I have issues to iterate map when i use map.equal_range() ..my compiler says there is no no match for 'operator=' in 's_it = Krange.std::pair<> and no match for 'operator != '?? I am confused and cannot figure out why following is piece of my…
user1830108
  • 195
  • 1
  • 15
0
votes
2 answers

how to redundant item from a multimap

I have some file like following i need to remove the a multimap 3KHJG 76 238 3KHJG 86 238 3GDMB 31 244 3GDMB 31 247 3GDMB 31 251 3KOFA 21 336 3KOFA 36 263 .... i need to get a file such as: 3KHJG 81 238 3GDMB 31 247 ..... //…
user1830108
  • 195
  • 1
  • 15
0
votes
3 answers

Faster methods for set intersection

I am facing a problem where for a number of words, I make a call to a HashMultimap (Guava) to retrieve a set of integers. The resulting sets have, say, 10, 200 and 600 items respectively. I need to compute the intersection of these three (or four,…
user1980127
  • 1
  • 1
  • 1
0
votes
1 answer

How i able to link following data

i have issues to link 3 element (s start, stop) together in the following code. map (start, stop) startomap; map > (n1, startomap); map (s, n1) m3; from m3 i am able to link string and n1, …
user1830108
  • 195
  • 1
  • 15
0
votes
1 answer

multimap query - order in which we store keys with multiple values

Possible Duplicate: how does the stl’s multimap insert respect orderings? I have a multimap as follows - multimap myMultiMap; myMultiMap[sKey] = s1; myMultiMap[sKey] = s2; myMultiMap[sKey] = s3; I add s1,s2,s3 in sequence. Later…
Omi
  • 976
  • 2
  • 20
  • 35
0
votes
4 answers

Cant print multimap because of iterator

Hey im trying to print out my multimap values but im getting an error on this for ( multimap< int, Questions, less< int > >::iterator iterator = question_map.begin(); iterator != question_map.end(); ++iterator ) cout << iterator->first…
0
votes
1 answer

trying to get multimap to print out questions

The multimap contains multimap map;. Im trying to get the map printing out using the following method: Questions* Questions::printQuestion(int level) { multimap::iterator it; pair
0
votes
1 answer

Error in my header and .cpp files

Possible Duplicate: What is an undefined reference/unresolved external symbol error and how do I fix it? Hey i am getting this error in my game. I have a header and .cpp file for Questions, so its obviously in that. but ive been looking through…
0
votes
1 answer

Remove duplicate key in a multimap

I have a multimap: std::multimap < string, string >::iterator iter_map; multimap < string, set > my.map; Typical output and data structure: key - value bird - air bird - earth fish - water lion …
user1871217
  • 35
  • 1
  • 6
0
votes
1 answer

Using an object variable for multimap equal_range()

I am using an object as a key for a multimap. The object is a custom date class which I created. I was just wondering if it is possible to use a variable found in the object for equal_range()? That is check against the month variable in my custom…
0
votes
2 answers

The constructor LinkedHashMultimap is not visible

The following code doesn't compile import com.google.common.collect.LinkedHashMultimap; public class Test { public static void main(String[] args) { LinkedHashMultimap p = new LinkedHashMultimap(); …
user1125394
0
votes
2 answers

Reference to multimap object

Is it possible to return a reference of an object inside a multimap? This is what I'm trying: return &this->noteList.find(key)->second; But I'm getting Non-const lvalue reference to type 'Note' cannot bind to a temporary of type 'Note *'so I was…
user393964
0
votes
1 answer

I got an invalid pointer from std::multimap.lower_bound

I use std::multimap.lower_bound method to return ranged result. But in the same content of container, sometimes I got the wrong iterators pair and it crash my program. I can see the content in container with visual studio, they are all correct. And…
naive231
  • 1,360
  • 1
  • 11
  • 28