Font size
WorksheetsY8 Search Algorithms: End of Topic Quiz
Total questions: 15
Worksheet time: 9mins
What is the linear search algorithm used for?
Searching data
Encrypting data
Deleting data
Sorting data
What is the first step in a linear search?
Examine value at counter position
Find out the length of the data set
Increment the counter by 1
Check if the value at position matches the value searched for
In a linear search, what happens if the value is found?
The counter is incremented
The search ends
The length of the data set is checked
The search continues
How many of the following statements (1-4) are disadvantages of a linear search?
It only works on ordered data sets
It is inefficient
It is not suitable for large data sets
It is complex to implement
Which of these statements about a linear search is TRUE?
It is efficient
It only works if the data is in order
The data does not have to be in order
It is suitable for large data sets
What is the purpose of the 'counter' in a linear search?
To store the value being searched for
To keep track of the number of items searched
To determine the length of the data set
To check if the value is found
12 6 8 1 3
How many comparisons would it take to find number 1?
A (a) search works effectively with (b) data sets and is (c) to program. A (d) search works effectively with (e) data sets and is more difficult to program.
If a LINEAR SEARCH was used to search the data shown here, which item is in the position for the WORST CASE SCENARIO?
1
60
88
100
If a LINEAR SEARCH was used to search the data shown here, which item is in the position for the BEST CASE SCENARIO?
10
60
88
100
If a BINARY SEARCH was used to search the data shown here, which item is in the position for the BEST CASE SCENARIO?
10
57
90
100
If a BINARY SEARCH was used to search the data shown here, select TWO items which are in the positions for the WORST CASE SCENARIO?
10
57
90
100
Look at the example dataset show here. Which ONE of the following statements about this dataset, is true?
Either a linear or binary search algorithm could be used with this data set
A binary search algorithm could be used with this data set
A linear search algorithm could be used with this data set
