Start with PLAI™
Back to the Library

Computing

Insertion sort tracer

Where should the next card go in the sorted part of the list? Predict its slot, then step through the comparisons and shifts. Use the highlighted pseudocode and step counts to discuss how insertion sort grows the sorted part one card at a time.

The held card 2, the open slot beside card 5 and the pseudocode for the first insertion.
Suggested ages 11 to 13 · Interactive activityEnglish

Read the material

Download PDF

A teaching sequence

Trace the held value and sorted prefix through insertion sort. Explain the difference between comparing two values and moving a card.

Predict the first insertion

Start with 5, 2, 4, 1, 3. Step forward to hold 2 and ask where it belongs among the first two slots. Select slot 1 and check the prediction before advancing.

Trace the shift

Ask why 5 shifts to the right when the held value is 2. Follow the highlighted pseudocode and check which action the activity records as a comparison and which as a move.

Explain each new prefix

Pause before a later insertion. Ask pupils to write down the sorted part, the held card and their predicted slot. Step forward after each pupil can justify the prediction.

Before you teach

Look for the thinking behind an answer, choose the support your class needs and leave room for an independent response.

What to look for

A pupil can explain why the sorted prefix grows after an insertion and identify which cards still need processing. Ask them to describe the same position using the display’s slot number and the corresponding code index.

Give a little support

Use three paper cards before the screen activity. Physically hold the key card, leave its place empty and move the larger card to the right. Link each physical action to the on-screen step.

Take the idea further

Trace an already sorted five-card list and a reverse-order list on paper. Use the activity’s definitions to compare their counts and explain which input requires more shifts.

Things to keep in mind

One fixed five-card trace, slot predictions, step controls, a hint, pseudocode and the two counters. Reset original order restarts the trace. A print or download captures the current board as a still view.

Keep the idea. Make it yours.

Bring your topic, learning goal and class context to PLAI™, then review what you create.

Make one for my class

Ideas to try with your class

Sample teaching perspectives on what to try, what to adapt and what to watch for.

🖍️

Steady Marker

Hold the value two from the original five-card list and predict its insertion slot before stepping. Ask pupils to distinguish a comparison from the action of shifting a card.

📏

Step by Step

Use after pupils can order values and recognise list positions. Keep numbered slots beside zero-based code indexes and explain why the one-card prefix starts sorted.

⏳

Five More Minutes

Rehearse with three paper cards, holding the key and leaving a gap. Move a larger card right and connect that physical action with the displayed step.

🔖

Reread Reminder

The screen provides one fixed trace, and a download is a still view. Compare sorted and reverse-order lists on paper using the activity's definitions of comparisons and shifts.

Resource preview

PLAI™ V2 launch offer

Regular monthly price $10 Launch price $1

for your first month of Personal Pro