ABSTRACT

Traditionally, sorting algorithms have been part of introductory courses for decades. Often, the pedagogy has involved some of the elements: trace the algorithm when applied to one or more data sets; and Code the algorithm in whatever language is used in the course. To illustrate, an insertion sort is a fine choice for the first example of a simple sorting algorithm: it is easily understood and is extremely efficient when the data set is almost ordered. Numerous versions of standard sorting algorithms can easily be found on the Web. In an insertion sort, instead of taking an element out of an array, sliding elements up, and putting the element in its place, code on the Web swaps the element down one position at a time. In a merge sort, each recursive step may involve creating subarrays, copying data from an original array to the subarrays, and then merging the subarrays back into the original array.