DP Computer Science · HL / SL · B2 Programming

B2.4 Programming algorithms

Get started
Notes Quiz

Introduction to Search Algorithms

Search algorithms are fundamental tools in computer science used to locate a specific item (the target) within a collection of data. In IB Computer Science, you are expected to understand, construct, and trace two core search algorithms:

  • Linear Search , works on any list, sorted or unsorted
  • Binary Search , works only on sorted lists, but is far more efficient for large datasets

Choosing the right search algorithm depends on the structure of your data and how frequently it changes.

Search Algorithm: A step-by-step procedure used to locate a specific element (the target) within a data structure such as an array or list.

Target: The specific value or item being searched for within a dataset.

Exam Tip

Always ask yourself two questions before choosing a search algorithm:

  1. Is the data sorted?
  2. How large is the dataset?

These two factors will guide you to the most appropriate choice.

Free preview

9 more sections in this topic

← Previous topicB2.3 Programming constructsNext topic →B2.5 File processing
Koncepts

Learn it properly. Then practise like it's the real paper.

Start free

Features

  • Lessons
  • Past papers
  • Library
  • Homework Help
  • Duels

More

  • For parents
  • Compare
  • Plans & pricing
  • DP for students

Legal

  • Privacy
  • Terms
  • Account deletion

© 2026 Koncepts (product of PrepAiro, Inc). All rights reserved.
DP, IB, EE and TOK are terms of the International Baccalaureate Organization.

Made for IB DP students.