Please enable JavaScript to use CodeHS

IB Computer Science Standard Level

Lesson 14.6 Sorting

Description

In this lesson, students will students will explore and analyze Selection Sort and Insertion Sort. Selection Sort swaps the minimum value left in an array with the current array index. Insertion Sort shifts the already sorted section of an array to place the current array value in the correct index. This lesson corresponds with AP Computer Science A topic 7.6.


Objective

Students will be able to:

  • Apply selection sort and insertion sort algorithms to sort the elements of array or ArrayList objects
  • Compute statement execution counts and informal run-time comparison of sorting algorithms

Enduring Understandings

This lesson builds toward the following Enduring Understandings (EUs) and Learning Objectives (LOs). Students should understand that…

  • EU Con-2 Programmers incorporate iteration and selection into code as a way of providing instructions for the computer to process each of the many possible input values. (LO’s 2.J, 2.K, 2.L, 2.M)

  • EU Var-2 To manage large amounts of data or complex relationships in data, programmers write code that groups the data together into a single data structure without creating individual variables for each value. (LO’s 2.D, 2.E)