Skip to content
Exit presentation

Computational Thinking II

Steps written, steps taken

A search sheet lists the steps of a search, one per line. This one has 5 lines. Does every search take 5 steps?

The sheet: 5 lines, every time.
Step 1 of 4
  1. The sheet: 5 lines, every time.
  2. Card 104: found at look 1.
  3. Card 218: found at look 12.
  4. Same sheet. Different looks.

No. The sheet has 5 lines every time. A search can take 1 look or 12 looks.

The rule

A look compares a card with the one you want. One look at a card is one comparison. The number of looks a search makes is its steps taken.

The lines you write stay the same. The looks a search takes change with the card.

Searching one by one

A plain search checks the cards one by one. It starts at the first card.

A row of 12 cards, searched one by one by a plain search
Where the card isLooks
Place 11
Place 66
Place 1212
Not in the row (plain search)12

A plain search ignores the order. It cannot say "missing" until it has looked at every card. Any card it has not seen could be the one.

Tap a card. Count the looks.

Loading lab…

Jump to lesson

This track

  1. 0 Start here
  2. 1 Steps written, steps taken
  3. 2 Look at the middle
  4. 3 Ovals, boxes and diamonds
  5. 4 Give every case an answer
  6. 5 Predict, run, compare
  7. 6 The big picture
  8. 7 Track quiz

Other tracks