@Bittu: For the first part, I'm assuming that you are asking for the
number of paths from the upper left corner to the lower right corner.
The robot will take 2*N moves in the process, of which N must be to
the right and N must be down. Thus, the number of paths is the
binomial coefficient (2*N) choose N = (2*N)! / (N!)^2.

Dave

On Mar 1, 2:30 pm, bittu <[email protected]> wrote:
> Imagine a robot sitting on the upper left hand corner of an NxN grid.
> The robot can only move in two directions: right and down. How many
> possible paths are there for the robot?
>
> FOLLOW UP
> Imagine certain squares are “off limits”, such that the robot can not
> step on them. Design an algorithm to get all possible paths for the
> robot.
>
> Thanks & Regards
> Shashank Mani

-- 
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