map, unordered_map or vector ?
Hi i have a very simple question. I am trying to store a 2d array of integers but i don't know should i choose vector or map or unordered_map to store the data. So my particular case is:
A function in my program generates integers based on some input and those integers can span from 0 to 5*10^10. usually i get around two million ints that i need to associate to some other 2 mill ints. latter on i have to find and modify every stored int at least two times. exmp:
input > generate ints > store them into hash table
2 -> 198776
43239 -> 55
356 -> 762212
now i have to locate int associated with 2 and repeat this process for all numbers in the table -> i have a while loop from 0 to 5*10^10 and as a reach a particular number i check if it exists in my table and then change its value according to the present value (i repeat this twice) )
so given the above case what is the best way to store my numbers: map, vector or unordered_map? I need something that uses the smallest amount of memory and is fast. in other words efficient.