This is a part of code for A* algorithm. I want to know if this is good, or I'd be better off using static allocation of memory here (I think that would be better). But not very sure as new to C++. Also, I'm using grid for the algorithm so how do I delete this. Please guide. Any suggestions welcome. Thanks.
for (int i = 0; i<world.size()-1 ; i++)
{
for(int j =0; j<world[0].size()-1; j++)
{
Node* a = new Node(make_pair(i,j), world[i][j]);
grid[i].push_back(*a);
}
}