I am working with A* algorithm. I have a 2D grid, with some obstacles, and given the starting and final position, I find the shortest path between them.
Here's my pseudocode
while(queueNotEmpty){
removeFromPQ;
if(removed == destination)
found;
insertAllNeighbours;
}
Remove and insert are the function on priority queue(Heap), and is O(log(n)) time.
Considering the dimension of grid as N*N. How do I calculate the running time. i.e how many times will this loop execute? Is there any measure?