length[i] = length of current shortest path from v1 to vi using only vertices in Y as intermediates
touch[i] = index of last vertex in Y on current shortest path from v1 to vi
Initially, the length and touch arrays are shown below. Complete the trace of the algorithm.
2. What is the formula for the most frequently executed instruction? (where n is the # of vertices)
3. "Shopping-cart problem" - a listener wins a radio station contest where they can fill a single shopping cart with items from a grocery store. If the listener wants to fill the cart so as to maximize the total value within the cart, suggest criteria the listener should use to select items to put in the cart.