void findPaths(int x, int y, int depth)
{
if (isEnd(x,y)) showSolution(); // One path will be marked by
letters A,B,C...
else
{
maze[x][y] = 'A' + depth;
if (x (maze[x-1][y]=='1')) findPaths(x-1,y,depth+1);
if (y (maze[x][y-1]=='1')) findPaths(x,y-1,depth+1);
how to explain the output if instead of j-i we try to print i-j ?
On Saturday, October 13, 2012 3:36:49 PM UTC+5:30, bharat wrote:
#includestdio.h
main()
{
int *i,*j;
i=(int*)60;
j=(int*)71;
printf(%d,j-i);
}
--
You received this message because you are subscribed to the Google
@atul: in your solution object only can move down or right direction. but
in my problem object is free to move in any direction and hence there are ch
ances of cycle.. how to memoize cycle.
if there is cycle then your approach will give infinite solution.
consider this maze
1 1 0 0 0
1 1 0
BFS
On Sun, Oct 14, 2012 at 4:21 PM, Rahul Kumar Patle
patlerahulku...@gmail.com wrote:
response awaited!!!
anyone??
On Sat, Oct 13, 2012 at 12:31 AM, Rahul Kumar Patle
patlerahulku...@gmail.com wrote:
Pls help to solve this que.. does any one have DP solution for following
que.
@Rahul: Loop won't occur because when you are visiting any matrix element
then you are marking 1 in visited matrix. So second time it will be seen as
a already visited element and it will choose another element (or path if
exist) or will blocked.
On Tue, Oct 16, 2012 at 9:31 AM, Rahul Kumar Patle
@Rahul : yes i know and actually i posted this query on geeksforgeeks.
you can find my solution in comments , search for atul007 in the provided
link.It will work for all cases. now to find all path you need to do small
modification on the same code.
On Tue, Oct 16, 2012 at 9:31 AM, Rahul Kumar
@jaspreet : i dont find much difference between using BFS or
backtracking...which is doing similar to DFS.
On Tue, Oct 16, 2012 at 4:28 AM, Jaspreet Singh
jassajjassaj...@gmail.comwrote:
BFS
On Sun, Oct 14, 2012 at 4:21 PM, Rahul Kumar Patle
patlerahulku...@gmail.com wrote:
response