Don Mitchell's solution

@ftownes here's my answer to your programming problems.

I was a bit confused about the spec on the priority queue one and probably took a grossly different tack than usual. I think my approach is sound and reasonably performant, but I haven't done a thorough analysis. You'll see my comments.

Because it's been 2 years since I've done any Java, it's quite likely that some of my patterns aren't paradigmatic. That comes easily once dropped into the day-to-day.