Operation A
I have N vectors, each containing certain number of unique 3D points. For Example : std::vector<double*> vec1;
and like that
I am performing sort operation on each of the vector like:
std::sort(vec1.begin(), vec1.end(), sortCriteria());
std::sort(vec2.begin(), vec2.end(), sortCriteria());
std::sort(vec3.begin(), vec3.end(), sortCriteria());
Operation B
Suppose I have a vector called "all_point_vector" which holds the 3D points from vec1, vec2, vec3 ...
i.e. 3D points in all_point_vector = points_in_vec1 +.... +points_in_vector3.
and I am performing the sort operation:
std::sort(all_point_vec.begin(), all_point_vec.end(), sortCriteria());
My question is , which of the above methods (Operation A or B) will be faster in general? sorting a single vector (all_point_vector) or sorting individual vectors. I am just interested in the speed of execution of these two operations.
Thanks