Linear search (Edexcel GCSE Computer Science): Flashcards
📚Flashcards
Practise the cards
12 cards from this deck
ShowHide
Practise the cards
12 cards from this deck
Linear search is what type of algorithm?
Linear search is what type of algorithm?
Sequential
What is linear search also called?
What is linear search also called?
Brute force algorithm
What brute force algorithm means
What brute force algorithm means
No tricks/shortcuts, checks every item if needed
Where does linear search start?
Where does linear search start?
First item (index 0)
Two conditions that stop linear search
Two conditions that stop linear search
Item found or end of list reached
Purpose of 'found' variable in code
Purpose of 'found' variable in code
Boolean flag tracking if target found
Purpose of 'index' variable in code
Purpose of 'index' variable in code
Tracks current position in list
Types of lists linear search works on
Types of lists linear search works on
Sorted or unsorted
Advantage: implementation of linear search
Advantage: implementation of linear search
Simple to understand and implement
Disadvantage: speed on large lists
Disadvantage: speed on large lists
Can be very slow
Disadvantage: where search always starts
Disadvantage: where search always starts
Always starts from the beginning
Guarantee of linear search
Guarantee of linear search
Will find item if it exists
