Greedy-Approach.
Refueling only when you have to.

On 2011-1-22 15:59, snehal jain wrote:
Suppose you want to travel from city A to city B by car, following a
fixed route. Your car can travel m miles on a full tank of gas, and
you have a map of the n gas stations on the route between A and B that
gives the number of miles between each station.
Design an algorithm to find a way to get from A to B without running
out of gas that minimizes the total number of refueling stops, in O(n)
time.


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