← Sorting Networks (CS Unplugged)
Sub plan
Sorting Networks (CS Unplugged)
Generated from the original open resource by CS Unplugged. Built only from the resource — nothing invented. Free, no login.
Substitute Lesson Plan: Sorting Networks
Objective
Students will learn that computers can solve problems faster by working on several parts of a task at the same time (parallel processing), and will experience this concept firsthand by acting as "numbers" moving through a human sorting network.
Materials
- Resource: Sorting Networks (CS Unplugged), including the chalked court diagram and the Photocopy Master cards
- Chalk (to mark the sorting network on the ground/court, if not already drawn)
- Two sets of six numbered cards (cut from the Photocopy Master, page 73)
- A stopwatch (for the variation activity)
- An open outdoor space or large indoor space (gym/court)
Warm-up (~5 min)
- Gather students and explain: "Today we are going to become numbers being sorted by a computer!"
- Ask students: "If you had six numbers in random order, how would you put them in order from smallest to largest?" Take a few quick answers.
- Explain that computers can sort numbers faster by comparing several numbers at the same time instead of one at a time — that is what today's activity will show.
Main Activity (~25 min)
- Set up the network: If not already marked, use chalk to draw the sorting network pattern from the resource on the court (a series of connected lines and circles/nodes).
- Form groups: Organize students into groups of six. Explain that only one team uses the network at a time, so other groups will wait and watch.
- Hand out cards: Give each team member one numbered card from the Photocopy Master set. Make sure the six numbers are in jumbled (mixed-up) order before starting.
- Position students: Each team member stands in a square on the left-hand (IN) side of the court, holding their card.
- Explain the rules:
- Move along the chalked lines.
- When you reach a circle (node), stop and wait for another team member to arrive at the same circle.
- Compare your two cards. The person with the smaller number exits to the left. The person with the larger number exits to the right.
- Continue moving and comparing at each circle you reach.
- Run the first team through the network. Watch for errors — if a team makes a mistake, they must start again from the beginning.
- Check the result: When the team reaches the far (OUT) side of the court, check whether their numbers are in the correct order from smallest to largest.
- Rotate teams: Repeat with the second team using the second set of cards, and continue rotating until all students have had a turn (repeat if time and group size allow).
- Reinforce the rule with an example: Remind students of the key rule at each node/circle: the smaller value always goes left, the larger value always goes right.
Wrap-up / Exit Ticket (~10 min)
Gather students back together and ask them to answer (aloud or on paper) the following questions:
- In your own words, what is the rule for what happens at each circle (node) in the network?
- Were you in the correct order when you reached the other end of the court?
- Why might using a network like this help a computer sort numbers faster than comparing them one at a time?
(Teachers/subs can accept answers such as: "the smaller number goes left, the larger goes right"; and "because several comparisons can happen at the same time instead of one after another.")
If Time Remains
Introduce the stopwatch variation: Time how long it takes each team to move through the network from start to finish. Run two teams (one after another) and compare their times. Ask students: "Do you think a team could get faster with practice? Why might that be?"
Original licensed under CC BY-NC-SA 4.0. This teaching material is provided free by OER.ai.