Unit 3: Software development
Area of Study 1: Software development: programming
Outcome 1
Interpret teacher-provided solution requirements and designs, and apply a range of functions and techniques using a programming language to develop and test working software modules.
Examples of learning activities
Detailed example
Role-playing algorithms
The key knowledge requires that students know two sorting (selection and quick sort) and two searching (linear and binary search) algorithms. Providing verbal descriptions or showing a video/animation of these algorithms may help students to compare their algorithmic behaviour. However, many students may not fully grasp the concepts. Role-playing the algorithmic behaviours of these algorithms provides an approach to understanding these concepts and comparing the algorithms. The process for each is outlined below.
Linear and binary search
- Explain to students the algorithmic behaviour of both linear and binary search.
- On a piece of paper, ask students to write an appropriate random word. Teachers can choose whether the word is related to a particular context.
- Have students stand up in a random order showing the word on their piece of paper to the rest of the class. Act out the process of searching for the word using the linear search algorithm.
- Have students line up in alphabetical order of the words. Act out the process of searching for words using the binary search algorithm.
- Take a student’s place in line and ask them to perform the linear search algorithm again, searching for a different word. The rest of the class should be counting the number of comparisons being made.
- Take another student’s place in line and ask them to perform the binary search algorithm (searching for the same value as the previous student). The rest of the class should be counting the number of comparisons being made.
- Discuss what students observed as part of the process, in relation to differences in the algorithms and their efficiency.
Note: Teachers could extend this process to observe best and worst case scenarios for searching for items (for example, item being searched is first or last item in the list, or not in the list at all).
Selection and quick sort
- Explain the algorithmic behaviour of both selection and quick sort to students.
- On a piece of paper, ask students to write an appropriate random word. Teachers can choose whether the word is related to a particular context.
- Have students stand up in a random order showing the word on their piece of paper to the rest of the class. Remind them to take note of who is standing next to them on either side (important part of the reset). Act out the process of sorting words into alphabetical order using the selection sort algorithm. Have one student counting the number of passes, another counting the comparisons and the remaining students counting the number of swaps.
- Students should then reset back to their original order. Act out the process of sorting words into alphabetical order using the quick sort algorithm.
- Take a student’s place in line and ask them to perform the selection sort algorithm. Have one student counting the number of passes, another counting the comparisons and the remaining students counting the number of swaps. Swap places with the student (who performed the selection sort).
- Take another student’s place in line and ask them to perform the quick sort algorithm. Again, the class should be counting the number of passes, comparisons and swaps being made.
- Discuss what students observed as part of the process, in relation to differences in the algorithms and their efficiency.
Note: Teachers could extend this process to observe best and worst case scenarios for sorting lists (for example, list already in order or in total reverse).