MAKE IT YOURS

A world for every learner

Choose a grade to discover its colours and creative world.

Grade 12 Searching & Sorting Worksheet with Answers

Grade 12 (US) · Year 13 (UK) · Class 12 (India) · Computer Science

Unit 1: AlgorithmsClassic AlgorithmsCSTA 3B-AP-10

Counting the steps in linear and binary search and tracing bubble and selection sort passes. This free high school worksheet has 12 questions and a full answer key. Print it or save it as a PDF — every answer is checked by code, not guessed.

  • Answer keys checked by code
  • No ads, ever
  • No student accounts needed
  • Safety & privacy
Practice Sheetaethelsystems.com

Searching & Sorting

Grade 12 · Computer Science

Score___ / 12

Name

Class

Date

Learning goal: Classic Algorithms · CSTA 3B-AP-10

Directions: Read each question carefully and write your answer on the line. Use the diagram to help you.

RememberSearch & sort

Linear searchcheck one by oneup to n checksBinary searchsorted list: check middle,throw away halfBubble sortswap neighbours thatare in the wrong orderSelection sortfind the smallest,swap it to the front
  1. 1

    Bubble sort (smallest to largest). Write the list after the first full pass: 19, 8, 5, 41, 37, 30

    1908152413374305index
  2. 2

    Linear search checks items one by one from the left. List: 41, 38, 29, 32, 34, 12, 27, 40, 22. How many items are checked to find 29?

    410381292323344125276407228index
  3. 3

    Bubble sort (smallest to largest). Write the list after the first full pass: 29, 41, 35, 15, 37, 11

    290411352153374115index
  4. 4

    Binary search on the sorted list 7, 15, 17, 19, 20, 27, 32, 35, 36. Which number is checked first (the middle item)?

    70151172193204275326357368index
  5. 5

    Linear search checks items one by one from the left. List: 28, 13, 12, 25, 38, 16, 5, 33, 11. How many items are checked to find 11?

    28013112225338416556337118index
  6. 6

    Bubble sort (smallest to largest). Write the list after the first full pass: 22, 37, 16, 3, 36, 13

    22037116233364135index
  7. 7

    Bubble sort (smallest to largest). Write the list after the first full pass: 6, 36, 32, 23, 7, 13

    6036132223374135index
  8. 8

    Linear search checks items one by one from the left. List: 26, 16, 12, 19, 14, 35, 22, 6, 2. How many items are checked to find 6?

    2601611221931443552266728index
  9. 9

    Binary search on the sorted list 4, 14, 17, 18, 21, 23, 29, 31, 33. Which number is checked first (the middle item)?

    40141172183214235296317338index
  10. 10

    Bubble sort (smallest to largest). Write the list after the first full pass: 14, 21, 27, 18, 5, 15

    14021127218354155index
  11. 11

    Binary search on the sorted list 6, 7, 24, 25, 28, 30, 33, 37, 41. Which number is checked first (the middle item)?

    6071242253284305336377418index
  12. 12

    Bubble sort (smallest to largest). Write the list after the first full pass: 11, 29, 31, 37, 41, 32

    110291312373414325index

★ Challenge corner for fast finishers

A playlist app lets you switch each of 3 songs on or off. How many different playlists (including the empty one) are possible?

How did I do?

Teacher's comments

Free printable worksheets with answer keys · aethelsystems.com/worksheets/computer/12/search_sort

Answer key (click to show)
  1. 1.8, 5, 19, 37, 30, 41
  2. 2.3
  3. 3.29, 35, 15, 37, 11, 41
  4. 4.20
  5. 5.9
  6. 6.22, 16, 3, 36, 13, 37
  7. 7.6, 32, 23, 7, 13, 36
  8. 8.8
  9. 9.21
  10. 10.14, 21, 18, 5, 15, 27
  11. 11.28
  12. 12.11, 29, 31, 37, 32, 41
  13. ★8 (challenge corner)

Need another Searching & Sorting worksheet?

Generate unlimited fresh versions at easy, medium or hard difficulty, each with its own answer key. Free during our launch — no card needed.

Create a free account

How to use this worksheet

  • Use it for revision before a test, as homework, or as a timed practice set.
  • Students can self-mark with the answer key and note which question types they got wrong.
  • Generate several versions of the same topic for spaced practice in the weeks before an exam.

Can't find what you need? Tell us which worksheet to make next.

Frequently asked questions

Does this Grade 12 Searching & Sorting worksheet come with answers?

Yes. The full answer key is on this page, and it prints on its own page after the questions. Every answer is calculated or checked by code rather than written by an AI model, so the key is always correct.

How do I print it or save it as a PDF?

Click "Download PDF" to save a ready-to-print PDF with the answer key on the last page, or click "Print" to send the worksheet and answer key straight to your printer.

Can I get a different Searching & Sorting worksheet?

Yes. Create a free account to generate as many fresh Grade 12 Searching & Sorting worksheets as you like, at easy, medium or hard difficulty, each with its own answer key.

Is this worksheet free?

Yes. This worksheet is free to print, and Practice Sheet is free to use during our launch with no card needed.