subject

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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 16:30
The most common battery cable terminal is a that provides a large surface contact area with the ability to tighten the terminal onto the battery post using a nut and bolt.
Answers: 2
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. peter has launched a website that features baby products. however, clients often find they are unable to access the website because the server is down. which feature of cybersecurity should peter focus on for his website? a. data authenticity b. data privacy c. data availability d. data integrity e. data encryption
Answers: 3
question
Computers and Technology, 24.06.2019 13:30
In the rgb model, which color is formed by combining the constituent colors? a) black b) brown c) yellow d) white e) blue
Answers: 1
question
Computers and Technology, 24.06.2019 20:00
Which element will you include to present numerical on a slide? a: graph b: text c: flowchart d: shapes
Answers: 1
You know the right answer?
Given a grid with obstacles, we want to find the path that gets you to the end in the shortest amoun...
Questions
question
Mathematics, 18.05.2021 20:20
question
English, 18.05.2021 20:20
question
Geography, 18.05.2021 20:20
question
Mathematics, 18.05.2021 20:20
question
Mathematics, 18.05.2021 20:20
Questions on the website: 13722363