Searching Algorithms Flashcards

OCR GCSE J277 Computer Science specification

Linear Search

A searching algorithm that checks each element in a list one by one until the target value is found or the end of the list is reached.

1 / 10

Ready to master these flashcards?

Sign in to study with spaced repetition and track your progress.

Sign In to Track Progress

Terms in this set (10)

1

Linear Search

A searching algorithm that checks each element in a list one by one until the target value is found or the end of the list is reached.

2

Binary Search

A searching algorithm that repeatedly divides a sorted list in half to locate a target value.

3

Prerequisite for Binary Search

The list must be sorted before performing a binary search.

4

Efficiency of Linear Search

Linear search is less efficient for large datasets as it checks each element one by one.

5

Efficiency of Binary Search

Binary search is more efficient than linear search for large datasets as it reduces the search space by half with each step.

6

Step 1 of Linear Search

Start at the first element of the list.

7

Step 2 of Linear Search

Compare the current element to the target value. If they match, the search is complete.

8

Step 3 of Linear Search

If the current element does not match the target, move to the next element and repeat until the target is found or the end of the list is reached.

9

Step 1 of Binary Search

Identify the middle element of the sorted list.

10

Step 2 of Binary Search

Compare the middle element to the target value. If they match, the search is complete. If the target is smaller, repeat the search on the left half. If larger, repeat on the right half.

Genie

Want to Learn More?

Get personalised lessons, quizzes, and instant feedback from your AI tutor.

Start Learning