What is preferable to use to store a fairly large number of elements (simple types)? vector<pair<>>
or unordered_map
? And is there anything more productive than vector
for storing a one-dimensional list? Everywhere I see that instead of an array, when a dynamic number of elements is used, it is vector
that is used.
In the case of a one-dimensional list, you need to quickly add and delete. And look for the value through the pointer to the memory cell. In the case of a two-dimensional list, you need to search for the second value by the first, add, delete.