performance - speed of (vector of pairs) vs (pair of vectors) C++ -


Background: I've finished writing a game as a homework assignment. Where we had to make a game of hex. I decided to apply the board using 2D vector of nodes and used two vectors to keep track of the node's neighbors X and Y coordinates. Path find algorithm was similar to Dijkstra I used to determine a winner.

I have the disadvantage of using 2 vectors that they should always be in sync, but I am asking about speed. I also realize that a faster way to implement the board is possible. : To use 1D vector (which I realized half way to complete the program)

Question: In terms of raw motion, fast track with 2 vectors to track path detection algorithm (X, y) or do I use algorithm by using joints of joints fast Runs?

Choose whichever is most appropriate for your needs Should not be concerned about performance at this level.

By doing this, you probably already have performance advantages.


Comments