WorksheetsSearch & Sort Algorithms
Total questions: 18
Worksheet time: 18mins
Name
Class
Date
1.
Which type of lists are linear search algorithms used for?
a)
Unsorted lists
b)
Sorted lists
2.
A binary search algorithm will only work on a list which is in order. True or False
a)
True
b)
False
3.
Which one of the following is an advantage of a linear search?
a)
It takes a long time to find the item.
b)
It is a simple algorithm to write.
c)
It is more efficient than a binary search.
d)
It is a complex algorithm to write.
4.
Using a binary search why will the number 9 never be found in the following list:
11, 8, 13, 9, 7, 3
11, 8, 13, 9, 7, 3
a)
It does not work on numbers
b)
It only works on letters
c)
The list is not in order
5.
Which of the following descriptions best describes a linear search:
a)
Put the elements in order, check each item in turn
b)
Put the elements in order, compare with the middle value, split the list in order and repeat
c)
Elements do not need to be in order, check each item in turn.
d)
Elements do not need to be in order, compare to the middle value, split the list in order and repeat.
6.
Which of the following best describes a binary search:
a)
Put the elements in order, check each item in turn.
b)
Put the elements in order, compare with the middle value, split the list in order and repeat
c)
Elements do not need to be in order, check each item in turn.
d)
Elements do not need to be in order, compare to the middle value, split the list in order and repeat.
7.
A linear search is to be performed on the list:
12, 6, 8, 1, 3
How many searches would it take to find the number 1?
12, 6, 8, 1, 3
How many searches would it take to find the number 1?
a)
1
b)
2
c)
3
d)
4
8.
A binary search is to be performed on the list:
3, 5, 9, 10, 23
How many comparisons would it take to find the number 9?
3, 5, 9, 10, 23
How many comparisons would it take to find the number 9?
a)
0-1
b)
2-3
c)
4-5
d)
It can't be found
9.
What does a search algorithm do?
a)
Save data in a list
b)
Sort data in a list
c)
Write data to a list
d)
Search data in a list
10.
Which of the following is a search algorithm?
a)
A word search
b)
A binary search
c)
A number search
d)
A search engine
11.
Which of the following is a sort algorithm?
a)
A linear sort
b)
A bubble sort
c)
A ordered sort
d)
A binary sort
12.
A bubble sort goes through each pair in a list and swaps them if not in order.
a)
True
b)
False
13.
Which of the following describes a merge sort?
a)
Compares each pair and swaps
b)
List is split in two and merged together in order
c)
List is split into 2 and kept seperate
d)
None of the above
14.
Which of the following is NOT a sort algorithm?
a)
Bubble
b)
Merge
c)
Insertion
d)
Linear
15.
Which type of sort algorithm is this?
a)
Insertion
b)
Merge
c)
Bubble
16.
Which type of sort algorithm is this?
a)
Insertion
b)
Bubble
c)
Merge
17.
What is a trace table?
a)
A technique used to test algorithms for logical errors.
b)
A technique used for drawing in art.
c)
A type of sort algorithm
d)
A type of search algorithm
18.
What is pseudocode?
a)
Another way to write an algorithm. It is like 'fake' code.
b)
Uses symbols to represent an algorithm
100 %
