Computers and Technology

Given a grid with obstacles, we want to find the path that gets you to the end in the shortest amount of time, using dijkstra’s algorithm. in this grid, you can move in all 8 directions: up, down, left, right, and the 4 diagonals.

you have been working out, and you can climb over obstacles, but it takes you longer.
moving to a grid location without an obstacle takes 1 minute. moving to a grid location
with an obstacle takes 2 minutes.
input
• the first line contains an integer, n, the dimension of the nxn grid.
• the second line contains two space-separated integers, the starting position in the
order row column.
• the third line contains two space-separated integers, the ending position in the order
row column.
• the next n lines contain the space separated row. each element is either a o indicating
no obstacle or a x indicating an obstacle.
constraints
you can assume a path exists (and therefore that the starting and ending positions are os)
and that the starting and ending positions are in-bounds.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 17:00, kyleemarie2003
Companies that implement and apply an information system effectively can create
Answers: 1
image
Computers and Technology, 23.06.2019 20:30, batmandillon21
1. for which of the following are you not required to signal beforehand? a. changing lanes b. speeding up c. stopping
Answers: 2
image
Computers and Technology, 24.06.2019 02:40, homework1911
Has anyone seen my grandma shes been gone for 4 years already
Answers: 1
image
Computers and Technology, 24.06.2019 13:00, juuuuuu42
George heard about the benefits of a data warehouse. he wants to try implementing one for his organization. however, he is afraid that transferring data to the data warehouse will affect transaction time. which element ensures that transactions are not affected when moving data to a warehouse? when data is transferred to a data warehouse, the a area frees the source system to continue transaction processing.
Answers: 2
Do you know the correct answer?
Given a grid with obstacles, we want to find the path that gets you to the end in the shortest amoun...

Questions in other subjects:

Konu
Mathematics, 12.11.2019 08:31
Konu
Social Studies, 12.11.2019 08:31
Konu
Mathematics, 12.11.2019 08:31