Relative Content

Tag Archive for javaalgorithmknapsack-problemgreedy

What approach am I supposed to use here since the question is a greedy problem, I was thinking it’s a shortest path problem

A greedy Activity selection-esque Question
Shikri and his friend want to go from berlin to china, there are n train stations on the
way. After each stop shikri must buy his friend a sandwich, he does not like this plan, so
shikri wants to take a certain selection of trains to minimize the total number of stops.
Write a pseudocode for a most efficient algorithm to minimize the number of stops, analyze
your running time.

What approach am I supposed to use here sisnce the question is a greedy problem, I was thinking it’s a shorted path problem

A greedy Activity selection-esque Question
Shikri and his friend want to go from berlin to china, there are n train stations on the
way. After each stop shikri must buy his friend a sandwich, he does not like this plan, so
shikri wants to take a certain selection of trains to minimize the total number of stops.
Write a pseudocode for a most efficient algorithm to minimize the number of stops, analyze
your running time.