Incorporating problem-solving patterns in CS1
David Reed · 1998
In [Wall96], Wallingford describes an approach to introductory courses that is based on programming patterns, i.e., algorithms or problem-solving approaches that can be applied to various applications. By focusing on patterns such as "Input-Process-Test" or "Process all items in a collection", students reason at a higher-level of abstraction when solving problems. In addition, code schema can be provided which apply to certain patterns, and these schema then serve as frameworks for program development. (See also [Rist89], [Coad92], and [GHJV95].)Closely related to the patterns approach is the use of themes in a programming course. Selecting a particular idea (such as self-reference [Astr94]), methodology (such as formal specifications [MH96]), or application domain (such as databases [AR95]) provides a framework for learning new techniques and concepts. Once a concept has been studied in one context, new applications which similarly utilize that concept can be understood more easily.This paper describes the use of a particular problem-solving pattern, binary reduction, as a recurring theme in the CS1 course. Other problem-solving approaches, such as divide-and-conquer or generate-and-test, could similarly be used. By introducing problem-solving patterns early in the course and then revisiting them in different contexts, students learn to look for common characteristics in problems, and to use an existing solution as a framework for solving related problems. Perhaps more importantly, understanding the behavior of one problem solution can simplify the analysis of other problem solutions based on the same pattern.