Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
2.33/5 (3 votes)
See more:
there are 5 pots having different amount of water and total amount of water in all the pots is 10 liters.
now we want to have 2 liters of water in each pot but in minimum no of transactions.
in starting we can have an array showing the initial content of water in each of the pot or any other structure can also be used.
So please suggest me any algorithm or a way so that i can find an algorithm to solve above problem.
Posted
Comments
Dr.Walt Fair, PE 25-Aug-11 15:40pm    
Can we refill on beer before filling the pots?
AspDotNetDev 25-Aug-11 15:55pm    
As I was going to St Ives
I met a man with seven wives
Each wife had seven sacks
Each sack had seven cats
Each cat had seven kits
Kits, cats, sacks, wives
How many were going to St Ives?
Chuck O'Toole 25-Aug-11 18:12pm    
When you ment the man, was he going in the same direction as you or was he heading in the opposite direction? If opposite, did you avoid the head on collision?

You stated the man had seven wives but did he have any of them with him, did he leave one or more at home?

Please respond so I can accurately answer your question
Thank you for following all safety procedures
AspDotNetDev 25-Aug-11 18:21pm    
Good questions: http://en.wikipedia.org/wiki/As_I_was_going_to_St_Ives#Answers :-)
Chuck O'Toole 25-Aug-11 18:33pm    
Wow, thanks, I see I hadn't fully understood the question. I need to contemplate this some more. Somebody pass the pot of beer (or did I misread that too ;-)

Fill up the pots with water and wait for enough time to pass so there is only 2 liters of water left in the pots.

We don't do your homework
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 25-Aug-11 23:03pm    
Creative :-) my 5.
--SA
Hint : Think fullest to emptiest. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900