12.1. Comparing and Sorting¶
12.1.1. Objectives¶
Upon completion of this module, students will be able to:
Describe concepts of ordering and sorting
Develop methods to compare primitives and Objects
Describe and develop classes which implement the Comparable interface or the Comparator interface
Describe the behavior of various sort methods including: bubble sort, selection sort, and insertion sort
Discuss the relative efficiencies of various sort methods
Implement, test, and use various sort methods and methods which support comparisons
Identify when to use the Comparable interface vs the Comparator interface
12.1.2. Introduction to Ordering, Comparing, and Sorting [13:39]¶
Follow Along and Engage
Download the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!

12.1.3. Checkpoint 1¶
12.1.4. Interactive: Introduction to Sorting [12:51]¶
Follow Along and Engage
Download the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!

12.1.5. Checkpoint 2¶
12.1.6. Interactive: Selection Sort [12:36]¶
Follow Along and Engage
Download the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!

12.1.7. Checkpoint 3¶
12.1.8. Insertion Sort with an Array¶
Follow Along and Engage
Download the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!

12.1.9. Checkpoint 4¶
12.1.10. Insertion Sort with a Linked Chain [16:50]¶
Follow Along and Engage
Download the slides corresponding to the video. Take notes on them as you watch the video, practice drawing diagrams yourself!

12.1.11. Checkpoint 5¶
12.1.12. Programming Practice: Insertion Sort¶
12.1.13. Introduction to Comparators [11:22]¶
Follow Along, Practice and Explore
In Eclipse, use the Project > Download Assignment… menu command to download the exercise project named “ex12.01-Comparing”. Use this example to follow along with the following video. Feel free to experiment.
Refer to 01.02: Lab: LightBot for Beginners if you need to review the instructions for downloading Eclipse projects.
Video Slides 12.1.8.1-Comparators.pdf