Uni-Sine
Computer ScienceCourses

Search Algorithms: an interactive course

Search Algorithms is an interactive search algorithms course about finding things in data quickly. Its 24 short sections cover linear search, binary search and why it needs sorted data, counting steps, Big O notation, hash tables and collisions, trees and graphs, and depth-first and breadth-first search, with an animation or practice question in most of them.

Along the way it teaches the most useful idea in algorithms: measuring how the number of steps grows as the data grows, so you can tell which approach will still be fast with a million items.

What the course covers

SectionsTopicWhat you do
1 to 4What a search algorithm is, and linear searchRace searches against each other, then count the checks a linear search makes
5 to 9Binary search, and why the list must be sortedWatch the range halve, pick the middle item, then spot lists that are not sorted
10 to 11Counting stepsFind how many halvings a list of n items needs
12 to 14Big O notationWatch O(1), O(log n), O(n) and O(n²) pull apart as n grows, then match each to a task
15 to 17Hash tables and collisionsHash names into buckets, then find the bucket for a name
18 to 22Trees, graphs, depth-first and breadth-first searchWatch DFS use a stack and BFS use a queue, then order the visits
23 to 24Choosing the right searchPick the best search for real situations

Linear search checks items one by one, so it works on anything but may check every item. Binary search checks the middle of a sorted list and throws half away each time, so 32 items take at most 5 checks, because 2⁵ = 32. The course spends a section showing exactly how binary search goes wrong on an unsorted list. The AQA GCSE specification names these two searches and asks you to compare them.

Big O and hash tables

Big O notation describes how the steps grow: linear search is O(n), binary search O(log n). At a million items, log₂ n is only about 20. Hash tables go further, jumping straight to a key's bucket in O(1) on average, and the course shows what happens when two keys collide.

Trees and graphs

Not all data is a list. Depth-first search follows one branch as deep as it goes before backing up, using a stack. Breadth-first search visits a whole level before going deeper, using a queue, which is why it finds the nearest match first.

Try a question from the course

A linear search starts at the first item and checks each one in turn until it finds the target. In the list 4, 9, 2, 7, 5, 8, 1, 6, searching for 5 checks 4, 9, 2, 7 and then 5: five checks. Searching for 3, which is not there, checks all eight items before giving up.

Now count the checks for a new list, then press Mark to check your answer in the course.

Type how many checks linear search makes to find a target in a random list, or to give up.

Press Mark to have your answer marked in the Search Algorithms course.

Who this course is for

  • GCSE and A-level computing students revising linear and binary search, Big O, hash tables and graph traversal.
  • Beginner programmers preparing for coding interviews or university courses, who want the core ideas explained visually.
  • Anyone who wants to know why some programs stay fast as data grows and others grind to a halt.

What you need to know first

The course page suggests Programming Languages first. The code examples are short JavaScript, and logarithms are explained as counting halvings, so no advanced maths is needed.

How long it takes

There are 24 sections, and most take a few minutes. Learners without a plan can open two sections of a course a day, in order, so the whole course takes 12 days. A plan removes the daily limit and lets you jump straight to any topic, such as BFS and DFS. For more depth on single topics, see the binary search trees, hash tables and sorting algorithms guides.

Interactive calculatorAlgorithm VisualiserWatch BFS, DFS, Dijkstra and A* search a grid you can draw on, step by step, with the real code beside each step.

Common questions

Is this search algorithms course free?
You can take every section without paying, two sections a day, in order. A plan removes the daily limit and opens any section straight away.
What is the difference between linear and binary search?
Linear search checks every item in order and works on any list, taking up to n checks. Binary search needs a sorted list but halves the search each time, taking about log₂ n checks.
Why must a list be sorted for binary search?
Binary search decides which half to throw away by comparing the target with the middle item. That only works if smaller items are all on one side and larger ones on the other.
What is Big O notation?
A way of describing how an algorithm's steps grow as the input size n grows, keeping only the fastest-growing part. O(1) stays the same, O(log n) grows very slowly, O(n) grows in step with n and O(n²) grows much faster.
What is the difference between BFS and DFS?
Breadth-first search visits every node on one level before going deeper, using a queue. Depth-first search follows one branch to the end before backing up, using a stack.
Does the course cover sorting algorithms?
No, it focuses on searching. Sorting algorithms such as bubble sort and merge sort are covered in our sorting algorithms guide and the Algorithm Visualiser.

Revision cards

Say the answer first, then flip the card to check it.

Where to go next

  • Solve it

    Algorithm Visualiser

    Watch sorting and pathfinding algorithms run step by step

    Open the tool
  • Learn it

    Search Algorithms

    Linear, binary, depth-first and beyond: find data fast with the right algorithm

    Start the course
  • Test it

    GCSE Computer Science

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Computer Science · Programming and algorithmsBinary search tree: insert, search, delete and traversalHow a binary search tree works: the ordering rule, searching, inserting and deleting, in-order, pre-order and post-order traversal, and Big O, with code.