DFS would work I think, if you try to find shortest path, use BFS

On Mar 1, 3:30 pm, bittu <shashank7andr...@gmail.com> 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 algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to