Can you write some pseudo-code for your algorithm?

I think it has a problem with how-much-time-to-wait-in-one-lane.
For example, there are two lanes and cars are coming as:

lane1   10 5 4 3 2 1
lane2   9 6 3

So, the times when the car is not there will be:

lane1  9 8 7 6
lane2  10 8 7 5 4 2 1

So, jumping to a lane is possible only when staying in that lane is
allowed till the next jump.
When that is put in, the algorithm essentially becomes the same as the
recursive algo given above.



On Jul 16, 6:04 pm, Ashish Goel <ashg...@gmail.com> wrote:
> it does have, have been thinking on this since y'day and it will still work
> with a little modification
> in case there is a path, it indeed covers move back possibilities with two
> adjacent lane timings>2
>
> alternatively, if frog moves back ,based on current time, only possible
> entries after the current time need to be looked at in the current lane
>
> Best Regards
> Ashish Goel
> "Think positive and find fuel in failure"
> +919985813081
> +919966006652
>
>
>
> On Thu, Jul 15, 2010 at 11:47 PM, Tech Id <tech.login....@gmail.com> wrote:
> > Hi Ashish,
>
> > Your algo does not have a chance for jump_back.
> > This may be required for certain cases, especially when multiple cars
> > are running on one lane.
>
> > My solution was for one car on one lane, hence car_times[i] gives the
> > car in i-th lane will take to hit the path frog is trying to cross.
> > It should not be too difficult to put multiple cars on single lane in
> > my algo.
>
> > Actually, from a game perspective, the problem can have many parts
> > like:
> > speed of cars vary,
> > frog can move sideways too instead of vertically on the road.
> > frog can make upto m jumps
> > etc etc.
>
> > Regards
> > Techie
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Algorithm Geeks" group.
> > To post to this group, send email to algoge...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > algogeeks+unsubscr...@googlegroups.com<algogeeks%2bunsubscr...@googlegroups 
> > .com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/algogeeks?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@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