ABSTRACT

This chapter offers the use of algorithms and data structures, highlights important points, and encourages readers to integrate concepts. It introduces insertion Sort, since it has about the same level of coding difficulty, but Insertion Sort also may be a good choice if data are already almost ordered. In defining a binary search tree (BST), for example, a presentation might begin with four examples, but the presentation also should formally identify the defining properties of BSTs. Examples of a binary search within an array may show an array to be sorted, but students should be told explicitly that an ordered array is a pre-condition rather than inferring this from examples. Sloppiness in stating specifications or proofs may undermine student perceptions of what constitutes a formal specification or a proof. Follow-up homework can then ask students to work through the details for a specific data set or for developing an actual program.