Greedy gets stuck
transcript
A session uses every handoff once. The code walks the smallest next track. It stops with some handoffs left over. Why?
Greedy takes zero to one first. Track one has nowhere to go. It stops.
Track one is a dead end. It must come last in the session. Greedy takes it first, because it is smallest.
Count exits minus entries for each track. One extra exit marks the start. Two starts mean no session exists.
Walk until a track is stuck. Write the dead end down. Reverse the written list at the end.
Greedy used two handoffs, not three. The log has three handoffs. Compare the two counts.
Test two separate pairs of links, with no session. Test a link from a node to itself. Test a link that appears twice.
A dead end must come last. Write nodes as they finish. Check every handoff was used. Full breakdown in the lecture.