Quote:Original post by saeedmSure, if you were actually moving it around a lot. In your case, you won't be. Again, this is a situation where you need to understand amortized complexity analysis in order to have an informed opinion.
Q1:Wouldn't an array of pointers to objects always perform better, since the actual object would remain in the same place in memory and the only data moved around when operations are performed on the array would be the actual 4byte pointers?
Quote:Q2:I need to dynamically allocate my Vertex's and Edges, is the following the only way of doing it, while storing them in a Vector? It seems like data is being copied around unnecessarily...
Your code has a memory leak and allocates memory for no good reason. Generally you would do:
myVector.push_back(Edge(2,3,10));