

Linear & Binary Search
Unit 3 Summary - part 4

Linear Search
​
Searches from the beginning, one by one
​
-
Advantage: Can search unsorted list.
-
Disadvantage: Slow to search if there are many items in the list.

If Linear Search were made into a Spanish dance,
it would look like this:

Binary Search
Searches from the middle and ignores the rest of the list
(if it's lower/higher than what we're looking for)
​
​
-
Advantage: Very fast to search if we have so many items (because it ignores the rest if it's lower/higher than what we're looking for).
-
Disadvantage: The list needs to be sorted first. Not so fast if we only have few items in the list.



If Binary Search were a flamenco dance, it would be entertaining:

Oxford AQA IGCSE Specimen paper

10.
Figure 8 shows a list of names stored in an array called Names.
Figure 8
Names

10.1.
If a linear search is being used to try and find the name “Ray” in the Names array how many comparisons will be made? [1 mark]
​
__________________________________________________________________________________
​
Answer:
7

10.2.
If a binary search is being used to try and find the name “Ray” in the Names array how many comparisons will be made? [1 mark]
​
__________________________________________________________________________________
​
Answer:
2
​
​
​
10.3.
For each statement shade in a box to show if the statement is true or false.
​
Statement

Answers:
​
-
False;
-
False;
-
True;
-
False;

