Do not have students write code for common algorithms. Instead, incorporate common algorithms into your class in novel course-specific variants

  • With common algorithms, it is too tempting to cheat (copy it from a text or the Web).
  • Have students code a particular-to-the-course variant; or, after supplying students with the algorithm, have them apply it to solve a problem. Additionally, you can have students compare the algorithm to another similar one and comment on the trade-offs of using each.
    • For example, instead of having students code quicksort, provide the algorithm or code for quicksort and insertion sort, then have students compare and contrast the sorts’ performances using different sizes and different types of data sets.
    • Or have students use quicksort until subarrays are of size n, then switch to insertion sort to complete the sorting. Next, have students determine the n for different data sets that produces the fastest sort.
  • When feasible, make the common algorithm an integral part of a larger, more application-oriented problem.
    • For example, have students use decision trees to help win a game or answer a question. In developing the program, the need to invoke tree-searching algorithm(s) will arise naturally, helping students appreciate that algorithms are critical to solving real-world problems.

More about this tip

External Source

Interview with Norm Jacobson