I'm coding what has to be a high-performance program.
What I have now is an array of vectors of type "A" that I've invented. The "A" is an struct that have a long long and a double.
vector<A>* ord = new vector<A>[X];
Where X is a value that i don't know until executing time.
What I have to do is, for each vector, sort its objects by the long long variable and then perform some operations.
My question is, it's better in terms of performance what I have now `An array of vectors' or it's better to create a vector of vectors like this:
vector<vector<A>> ord;
Two thinks:
- Notice that I don't have to do operations between vectors.
- I have read in other post that it's a bad idea to use `new' operator, in this case, what I shoud use in my program.