On the weekend I will attend a programing competition and I would like to know whether should I use std::vector or std::map? I would use them simply as arrays but I am confused which is the better(mostly speed for basic operations)?
I saw this pic on stackoverflow and I have no idea which is the main difference between these...
The picture suggest that vector is faster... I really don't know what to do pls help me! I need to use them only like arrays but with dynamical size... Thanks in advance,
EDIT I will probably get a 2D array of integers (for example a map of a city or a labirinth and I would be given some kind of problem that could be solved with graph-algorithms or dynamic programming), so the things I will need are: write, read specific cells of the "table", search for specific values, and I guess thats all. I heard that std::map won't locate the full N*M sized table in the memory, but I will do it value by value... So is it true that it may use less memory?
Sorry for being so silly but I have never had any real teachers I learned all that I know on my on. I just started to learn about data structures(2-3 trees, red-black trees, binomial heaps, and so on...)