Jump to content

I'm a software engineer, get me out of here: Difference between revisions

no edit summary
(Created page with "{{draft task}} Your latest contract has hit a snag. You came to update the army payroll system, but awoke this morning to the sound of mortars landing not far away and panicke...")
 
No edit summary
Line 1:
{{draft task}}
Your latest contract has hit a snag. You came to update the army payroll system, but awoke this morning to the sound of mortars landing not far away and panicked generals banging on you door. The President has loaded his gold on trucks and needs to find the shortest route to safety. You are given the following map. The top left hand corner is (0,0). You and The President are located at HQ in the centre of the country (11,11). Cells marked 0 indicate safety. Numbers other than 0 indicate the number of cells that his party will travel in a day in any direction up, down, left, right, or diagonally.
<pre>
00000
Line 26:
00000
</pre>
Part 1 Use Dijkstra's algorithm to find a list of the shortest routes from HQ to safety.
<br>
Part 2<br>
Six days later and you are called to another briefing. The good news is The President and his gold is safe, so your invoice may be paid if you can get out of here. To do this a number of troop repositions will be required. It is concluded that you need to know the shortest rout from each cell to every other cell. You decide to use Floyd's algorithm:
2,172

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.