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
-1
votes
1 answer

Floating Point Exception while reading from file

the program should read from 2 files (author.dat and citation.dat) and save them into a map and set; first it reads the citationlist without problem, then it seems to properly read the authors and after it went through the whole list (author.dat) a…
frost
  • 13
  • 1
-1
votes
2 answers

Performance in Nesting three maps Vs Separate maps in C++

I am confused to choose between the two methods to have a STL structure , Method A: map,map>*>*> Method B: Is the above advisable or having a separate maps like…
Sel_va
  • 588
  • 5
  • 25
-1
votes
2 answers

How can I overload equal method to make different objects have same hashcode value in unordered_multimap in my case

I have written a map like this: unordered_multimap map StrHash() is to create hashcode and StrCompare() is to solve the hashcode collision. but I want to do something as follow: A and B have different hashcode…
GKG DTH
  • 117
  • 1
  • 10
-1
votes
1 answer

Multimap Iterator retrieve multiple values in Java

Is there a way to access each value to assign it to a variable from a java MultiValueMap from Apache commons while iterating? I have one key and two possible values that I would like to extract each iteration that are later written to a table.…
caro
  • 863
  • 3
  • 15
  • 36
-1
votes
2 answers

Retrieve multimap values sequentially

Using the new collections from Google's Guava, i was building a Map and adding values as multimap.put("Date",somestring); multimap.put("AccountNo",somestring); multimap.put("Amount",somestring); multimap.put("Status",somestring); Now while…
Wasim Wani
  • 555
  • 2
  • 11
  • 24
-1
votes
2 answers

how to convert json into key value pair completely using groovy

i m trying to convert json into map as key value pair i have a method JsonSlurper() which give me the key value pair but my query is i have a json as…
naval dogra
  • 9
  • 1
  • 7
-1
votes
2 answers

LinkedListMultimap or MultiMap sequence

I have the following multiMap: 1st: [3=>[4,5]] 2nd: [2=>[3]] 3rd: [0=>[2]] 4th: [5=>[1]] 5th: [4=>[1]] I would like to get the sequence out of it such as: 0->2->3->[4,5]->1 Is it possible? This is what I have tried, but doesn't seem to work…
Zuser
  • 59
  • 1
  • 6
-1
votes
1 answer

store current and next iterator

I have a loop that iterates through each of the each key and then each of the values for those keys. I create a RoadSegment for each point and want to use the values to set the coordinates of the RoadSegment. To do this I need the current vec3 that…
willgosling
  • 23
  • 2
  • 6
-1
votes
2 answers

Optimizing the Dijkstra's algorithm

I need a graph-search algorithm that is enough in our application of robot navigation and I chose Dijkstra's algorithm. We are given the gridmap which contains free, occupied and unknown cells where the robot is only permitted to pass through the…
Xegara
  • 563
  • 2
  • 10
  • 23
-1
votes
2 answers

How to sort object using a multi map?

Hi I'm trying to sort an object based on a value of that object. Originally I used TreeMap which did the sorting but there were some non-unique keys which were removed so that didn't work. I googled around and came across Guava MultiMap. But how do…
OneTwo
  • 2,291
  • 6
  • 33
  • 55
-1
votes
2 answers

Retrieve individual entries of hashmap with same key

I have created a Hashmap which has multiple entries for a single Key entry. Now I want to retrieve all values individually. How can I do this? I have checked many sites but couldn't get a clue on how to implement it, and an example code snippet can…
Siva
  • 9,043
  • 12
  • 40
  • 63
-1
votes
3 answers

How do I convert the values in a Map from List of Strings to a String?

Currently I have a map containing key as a string & values as a list of strings. Map> How can I convert these values from list of strings to a single string? eg: Below are the values which are contained in my map . {id=[1057-27620],…
user3561824
  • 139
  • 1
  • 7
-1
votes
1 answer

C++ - How to create new instance of a multimap using new operator?

I am trying something like this - //creation of multimap multimap prioritized_list; //declared pointer for multimap multimap ::const_pointer plist_pointer; //tried to create instance of multimap. plist_pointer=new…
-1
votes
1 answer

Return content of multimap

Here I have used multimap and at bottom part printing the content of it. Generally I work with array only and return and fetch content of array easily. like: void main(){ char *ch; ch=client(); //function call //Now we can get ch[0]... } char…
user123
  • 5,269
  • 16
  • 73
  • 121
-1
votes
1 answer

Initialize static multimap class member

I'm need a static member from the type multimap I checked that static members must be initialized (or defined) after the class declaration The problem is that I'm not finding the correct sintax to initialize (define) the multimap that I…
vvill
  • 1,100
  • 2
  • 12
  • 21