|
-
October 5th, 2009, 01:29 PM
#1
problem with breadth first search
how do i implement breadth first search using a queue to find the shortest path from the upper left corner to the lower right corner, if there is one.A path can only go up, down, or sideways (not diagonally) and must only pass through zeros. The ones are walls. The number of rows will not exceed 40, and the number of columns will not exceed 78. if im not being clear this is an example.
input:
3 5
01000
00010
01010
output:
01000
00010
01010
( 1, 1)( 2, 1)( 2, 2)( 2, 3)( 1, 3)( 1, 4)( 1, 5)( 2, 5)( 3, 5)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|