Hi, you can do this by recursion ,

printPath (int length)
{
 if(lenght == N) return;
else
{
  if(lenght+1 >= N)  { Printf (" -->one step -->") call printPath (length+1)
}
 else if(lenght+2 >= N)  { Printf (" -->two steps -->") call printPath
(length+2) }
else
return;
}
}
On Sun, Aug 28, 2011 at 5:42 PM, himanshu kansal <
[email protected]> wrote:

> you have a path of N steps....
> at every step, you can take onl;y 1 step or 2 steps.....
>
> how to print all the possible paths that you can take......
>
> PS: please dont give the exact code.....your approaches will be
> appreciated....:)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>
>


-- 
Yours affectionately,
Prashant Thorat
Computer Science and Engg. Dept,
NIT Durgapur.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to