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)