| | |
Data Structure Problem
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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
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
•
•
Join Date: Jul 2005
Posts: 244
Reputation:
Solved Threads: 5
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.
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.
![]() |
Similar Threads
- Some Data Structure Problem (C++)
- Data Structure question (C++)
- a question about heap data structure (C)
- Data Structure Using JAVA (Java)
- How to delete a data structure in Builder 6.0? (C++)
- Discrete Math or Data structure (Computer Science)
Other Threads in the C Forum
- Previous Thread: source code
- Next Thread: Need Help With Piglatin Program In C
| Thread Tools | Search this Thread |
#include adobe api array arrays asterisks binarysearch calculate char cm copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax database directory dynamic feet fflush fgets file fork forloop framework frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hacking hardware highest homework i/o include incrementoperators input interest kernel kilometer linked linkedlist linux linuxsegmentationfault list lists locate logical_drives loopinsideloop. match matrix meter microsoft motherboard mqqueue multi mysql number odf opensource owf pattern pdf performance pointer posix probleminc process program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling scripting segmentationfault sequential shape socket socketprograming stack standard string strings systemcall testing turboc unix user voidmain() wab windows.h





