Lesson details

Key learning points

  1. In this lesson, we will be introduced to one of two searching algorithms we need to know about: linear search. We will go over the steps of carrying out a linear search, and perform a linear search in real life and with a sample of data.

Licence

This content is made available by Oak National Academy Limited and its partners and licensed under Oak’s terms & conditions (Collection 1), except where otherwise stated.

Loading...

4 Questions

Q1.
'Calculates the remainder of a division.'
Integer division
Correct answer: Modulo (MOD)
Q2.
'Calculates the whole number of times the divisor will go into the dividend '
Correct answer: Integer division
Modulo (MOD)
Q3.
State the result of the following calculation in Python: 14 % 4
1
Correct answer: 2
3
4
Q4.
State the result of the following calculation in Python: 28 // 5
Correct answer: 5
6
8
9

4 Questions

Q1.
What card would you need to search for, for the best-case scenario to occur?
10
Correct answer: 6
7
8
9
Q2.
What card would you need to search for, for the worst-case scenario to occur?
10
6
7
Correct answer: 8
9
Q3.
How many comparisons would it take to work out that a card wasn’t in the set of cards?
10
6
7
Correct answer: 8
9
Q4.
When carrying out the linear search, does the data need to be ordered?
Correct answer: No
Yes

Lesson appears in

UnitComputing / Algorithms

Computing