hw2 - Your goal is to make as few gas stops as possible...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework #2 1. Suppose you were to drive from USC to Santa Monica along I-10. Your gas tank, when full, holds enough gas to go p miles, and you have a map that contains the information on the distances between gas stations along the route. Let d 1 < d 2 < · · · < d n be the locations of all the gas stations along the route where d i is the distance from USC to the gas station. We assume that the distance between neighboring gas stations is at most p miles.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Your goal is to make as few gas stops as possible along the way. Give the most efficient algorithm to determine at which gas stations you should stop and prove that your strategy yields an optimal solution. Give the time complexity of your algorithm as a function of n. 2. Problem 4 in Chapter 4 3. Problem 13 in Chapter 4...
View Full Document

This note was uploaded on 02/15/2011 for the course CS 570 taught by Professor Shahriarshamsian during the Spring '08 term at USC.

Ask a homework question - tutors are online