3 ms·
Actually for grid navigation there's no need for a priority queue. All steps are of length 1, so you can keep two arrays. In the first one all the things that
by furstenheim 5y ago
Actually for grid navigation there's no need for a priority queue.
All steps are of length 1, so you can keep two arrays. In the first one all the things that you are currently visiting and push to the second array the neighbors that you'll visit in the next cycle. Once you are done swap arrays and start over.