I think this will help: http://en.wikipedia.org/wiki/Frogger
Consider the roads to be n-laned and of constant width with constant time traffic coming on each lane.For example,say after 1 minute,a car comes on each lane but in a arithmetic sequence and not all at same time.To make it more clear, at t=1 minute,car at lane 1 travelling with constant velocity v and takes "T" time to cross the screen/lane1. at t=2 minute,another car comes now in lane 2 with same constant velocity and so on.......... Now the frog can cross one lane either back or forth in one jump.These are the only movements allowed.The jump time is considerable(say in above case 1 minute only).Note that times are all not correctly mentioned and consider times which are appropriate for the problem.The time details are mentioned to make everyone understand the problem. Design an algorithm to guarantee that the frog crosses the road safely. Think first..........................Hint is downwards......................... . . . . . . . . . . . . .. . . . . . . . . . . . . Hint: Think in terms of multithreading,semaphores,mutex and vectors etc.......... On Wed, Jul 14, 2010 at 11:33 PM, Tech Id <[email protected]> wrote: > A frog has to cross a road to meet > its beloved she-frog at the other end. > > The road however has cars coming and > can crush the frog. > > Road is two lanes wide. > > Devise an algorithm to help the frog carry on its family. > > (I am sorry but it seems that I have missed > some parts of the problem here. If someone > remembers the complete question, please help me). > Thanks in advance! > > -- > 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]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- Regards, Ashish -- 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.
