What is the difference between std::list<std::pair>
and std::map
? Is there a find
method for the list, too?
std::map<X, Y>
:
X
s) onlyfind()
method (O(log n)
) which finds the Key-Value pair by Keymap[key]
, which is also faststd::list<std::pair<X, Y> >
:
X
s and Y
s. They remain in the order you put it in.list
is O(N)
(no special method)splice
method.