Exploring Linear Search Algorithms
Slide 1

Exploring Linear Search Algorithms

Year 7 Technology 60-minute lesson Understanding how computers search for data

National Curriculum Links
Slide 2

National Curriculum Links

Key Stage 3 Computing objectives Understanding algorithms and how they work Designing and writing programs with sequences Using logical reasoning to explain algorithms Focus on search and sort data methods

Learning Objectives
Slide 3

Learning Objectives

Explain what a linear search is and when to use it Demonstrate how linear search works on data lists Design and write simple linear search pseudocode Evaluate the efficiency of linear search methods

How Do You Find Things?
Slide 4

How Do You Find Things?

Think about finding your favourite book in a messy pile What steps would you take? How do you search through your phone contacts? What about finding a word in a dictionary?

What is Linear Search?
Slide 5

What is Linear Search?

A step-by-step method to find an item in a list Checks each item one by one from start to finish Stops when the target item is found Simple but thorough approach Also called 'sequential search'

Linear Search Example: Finding Number 7
Slide 6

Linear Search Example: Finding Number 7

Physical Search Activity
Slide 7

Physical Search Activity

Work in pairs with number cards One student picks a target number Partner performs linear search by moving through cards Describe each step out loud Swap roles and try again Time yourselves for different list sizes

Writing Linear Search Pseudocode
Slide 8

Writing Linear Search Pseudocode

START with a list and target value SET position to first item REPEAT: Compare current item to target IF match found: RETURN position IF not match: Move to next position IF end of list reached: RETURN 'not found'

Advantages vs Disadvantages
Slide 9

Advantages vs Disadvantages

{"left":"Simple to understand and implement\nWorks on any type of data\nNo need for sorted data\nGuaranteed to find item if it exists","right":"Slow for large lists\nChecks every item in worst case\nNot efficient for repeated searches\nBetter methods exist for sorted data"}

Independent Practice Worksheet
Slide 10

Independent Practice Worksheet

Trace through a linear search example Write your own pseudocode Calculate steps needed for different scenarios Challenge: Compare with other search methods Extension: Find multiple occurrences Support available for additional help

Quick Check: True or False?
Slide 11

Quick Check: True or False?

Linear search checks every item until it finds a match Linear search only works on numbers Linear search is the fastest search method Linear search can tell you if an item doesn't exist

Summary and Next Steps
Slide 12

Summary and Next Steps

Linear search is simple but thorough Checks items one by one sequentially Useful for unsorted data and simple problems Not efficient for very large datasets Next lesson: Binary search for sorted data Real-world applications in file systems and databases