Linear search (Edexcel GCSE Computer Science): Flashcards

📚Flashcards
Linear search
Sign up to keep revising.Create a free account to study more flashcards and track your progress.

Practise the cards

12 cards from this deck

Show

Linear search is what type of algorithm?

Sequential

What is linear search also called?

Brute force algorithm

What brute force algorithm means

No tricks/shortcuts, checks every item if needed

Where does linear search start?

First item (index 0)

Two conditions that stop linear search

Item found or end of list reached

Purpose of 'found' variable in code

Boolean flag tracking if target found

Purpose of 'index' variable in code

Tracks current position in list

Types of lists linear search works on

Sorted or unsorted

Advantage: implementation of linear search

Simple to understand and implement

Disadvantage: speed on large lists

Can be very slow

Disadvantage: where search always starts

Always starts from the beginning

Guarantee of linear search

Will find item if it exists

Join 100,000+ GCSE students studying Flashcards with us.

Select your subjects, and get access to A+ resources today.