vendredi 30 décembre 2016

Vector of vector vs Vector

In C++11, how does vector(outer) of vector (inner) (2D) performs against 1D vector in terms of time?
In the 2D vector given, all the inner vectors are of the same size.

Ex: std::vector> X{10, std::vector(4)};
vs
std::vector Y(40);

Which avatar of the vector would perform better When the elements are randomly accessed?

Aucun commentaire:

Enregistrer un commentaire