The design and coding of greedy algorithms revisited

In this paper we argue that the most typical instruction method used to teach greedy algorithms is inadequate at achieving certain learning goals and we present several contributions to alleviate this situation. Our first group of contributions highlights the role of selection functions and proposes separate treatment in their discovery and proof of optimality. For discovery, we outline some interesting cases of selection functions and for proofs, we examine the role of counterexamples. Furthermore, we argue that their separation provides more opportunities for instructional activities. Our second group of contributions concerns coding greedy algorithms. We discuss the role and adequacy of the template in current use, and also the role of sorting candidates and how to implement sorting.