Data Structure Problem

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2005
Posts: 2
Reputation: sandeepalankar is an unknown quantity at this point 
Solved Threads: 0
sandeepalankar's Avatar
sandeepalankar sandeepalankar is offline Offline
Newbie Poster

Data Structure Problem

 
0
  #1
Aug 8th, 2005
Hi,
I have a problem in data structures I am stuck in this one .Please try to help me.

Question : A man Joe has a habbit of eating pancakes & driving
bikes.Once he went for outside by his bike,now he is EXACTLY IN THE
MIDDLE OF A ROAD his stomach is crying for pancakes and also his
contact lenses are full of dirt.Now HE CANNOT SEE A PANCAKE SHOP UNTILL HE REACH THE PANCAKE SHOP EXACTLY BEFIRE IT.
Now please provide me the algorithm/code for finding the pancake shop which is nearer to JOE & also tell me how can I calculate time and space complexity.


Note: Information given as if he goes to the right side it is
considered as 1unit,2unit....and son on and if he chooses left then
-1unit,-2unit...and so on.


II)Second part of the problem says that if Joe wants to flip a coin for


,in which direction(left or right) he has to move.
Then what happens to the code/algorithm.


left<---- ------>right
Example:----------------------­­---------------------------


Road (Joe)in the middle of the road.


------------------------------­­--------------------


Thanks
Reply With Quote Quick reply to this message  
Join Date: Apr 2003
Posts: 46
Reputation: Dante Shamest is an unknown quantity at this point 
Solved Threads: 0
Dante Shamest's Avatar
Dante Shamest Dante Shamest is offline Offline
Light Poster

Re: Data Structure Problem

 
0
  #2
Aug 8th, 2005
Sounds like a request for us to do your homework. What have you done so far?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 2
Reputation: sandeepalankar is an unknown quantity at this point 
Solved Threads: 0
sandeepalankar's Avatar
sandeepalankar sandeepalankar is offline Offline
Newbie Poster

Re: Data Structure Problem

 
0
  #3
Aug 8th, 2005
Well it was asked in my interview and I have no clues how to start with it.
All I can analyze is that I have to use Trees and have to use random generator for flipping coin problem.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 105
Reputation: jhdobbins is an unknown quantity at this point 
Solved Threads: 3
jhdobbins jhdobbins is offline Offline
Junior Poster

Re: Data Structure Problem

 
0
  #4
Aug 8th, 2005
Originally Posted by sandeepalankar
Well it was asked in my interview and I have no clues how to start with it.
so i get the job if i do this and you dont??

sounds like you better learn it before you get a job in it.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 244
Reputation: Drowzee is an unknown quantity at this point 
Solved Threads: 5
Drowzee Drowzee is offline Offline
Posting Whiz in Training

Re: Data Structure Problem

 
0
  #5
Aug 8th, 2005
I got my job on a simpler question; a bit-level reverser. Thankfully, I picked up on the pattern fast enough that I didn't look too foolish.
Anyway: I'm not sure I understand the initial question. When does this guy (who should wear glasses or goggles; dirty contacts are dangerous!) know he's in front of a pancake house? When he gets there? Or, are there two pancake places next to each other on the same side of the street, so only when he gets to the first, he's aware of the second pancake house (but not the first)?

The way the original post went, it's not obvious what you mean.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC