IA 6 - Sort Assignment D - Selection and Insertion Sort
This assignment does not have you creating any new Main Class code. You are simply to learn about the remaining sort algorithms and add the methods to your Sort class. Details are below.
By now you already know how to bubble sort. This assignment covers 2 additional sort algorithms:
For each you will do two things: First you will find the code, then you will explain how it works.
Selection Sort - Add the code 30%
Need help learning about the Selection Sort algorithm, see Appendix A.
Selection Sort - Explain the code - 30%
Create a multiline comment to answer the following:
Insertion Sort - Add the code 20%
Need help learning about the Selection Sort algorithm, see Appendix A.
(more on next page)
Insertion Sort - Explain the code - 20%
Above one of the methods, in a comment: Using the analogy of sorting Cars by their Price to explain how Insertion Sort works. There is no specific right answer. A one sentence explanation with just the basic principle is good enough, as long as that explanation demonstrates you know the difference between the algorithms.
Find out what kind of data an Insertion Sort is good for and what kind of data it is bad for. Add this to your comment. Copying and pasting is allowed if you also provide the URL to your source website.
Appendix A - Learning about the Algorithms
If you were not around for the in-class explanations of the Selection and Insertion Sort algorithms (or if you just want some review), the following resources will help: