124,484 views
4 votes
4 votes
We wish to compute the laziest way to dial given n-digit number on a standard push-button telephone using two fingers. we assume that the two fingers start out on the * and # keys, and that the effort required to move a finger from one button to another is proportional to the euclidean distance between them. design and analyze an algorithm that computes in time o(n) the method of dialing that involves moving your fingers the smallest amount of total distance

User Eva
by
3.1k points

1 Answer

5 votes
5 votes

Answer:

R(i, k) + dist(d[k], d[i+1]) over all k < i

Step-by-step explanation:

User Keylee
by
2.7k points