World Book Logo Building Blocks
Sort the Animals
order character

Sort the Animals

Programmers use different kinds of sorting algorithms to organize information in a computer program. A sorting algorithm is a set of step-by-step instructions that puts information in the correct order.

Instructions:

One kind of sorting algorithm is the selection sort. In a selection sort, you find the biggest or smallest piece of information in a list and pull it out of the list. Then, you put it in a new list, in the correct spot.

Can you use a selection sort to sort the giraffes from tallest to shortest?

  1. First download and print the giraffe cards and the savannah board from the materials section.
  2. Cut out the giraffe cards and shuffle them. Then, place them all in a row in front of you.
  3. Find the tallest giraffe and place it in the first slot on the picture.
  4. Then, find the giraffe that is now the tallest in your row.
  5. Put that giraffe in the second slot.
  6. Keep going until all of the giraffes are in order from tallest to shortest.

You used a selection sort to sort the giraffes!