NEW
Font size
WorksheetsUNIT 2.1 ALGORITHMS
Total questions: 32
Worksheet time: 11mins
Q9: A linear search is to be performed on the list:
12 6 8 1 3
How many comparisons would it take to find the number 1?
1
2
3
4
Q10: 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?
0-1
43526
43589
It can't find the number 9
Q11: A binary search is to be performed on the list:
1 5 10 13 48 68 100 101
How many comparisons would it take to the find the number 101?
0-1
43497
43558
43589
Q12: Identify the search performed by the following algorithm:
for x = 0 to 9
if (array[x]==10) then
print(“Found it”)
endif
next x
Linear
Binary
Both linear & binary
Neither, it does not work
Q2: Which sorting algorithm is described by: moving through a list repeatedly, swapping elements that are in the wrong order
Merge
Bubble
Insertion
None of the above
Q3: Which sorting algorithm is described by: split a list into individual lists, then combine these, two lists at a time.
Merge
Bubble
Insertion
None of the above
Q4: Which sorting algorithm is described by: take each item in turn, compare it to the items in the sorted list and place it in the ordered position in the sorted list.
Merge
Bubble
Insertion
None of the above
Q6: The following two lists are to be merged, which element first goes into the new merged list (4-5)
List 1: 2 4 8 9
List 2: 1 6 8 4
0
1
2
3
Q7: The following list is to be sorted using a bubble sort:
12 6 8 1 3
What will the list look like after the first iteration through the list.
6 8 1 3 12
6 12 1 8 3
1 3 6 8 12
6 8 1 12 3
Q10: Which sorting algorithm is described by: take each item in turn, compare it to the items in the sorted list and place it in the ordered position in the sorted list.
Merge
Bubble
Insertion
None of them do
Q2: Identify the purpose of the following flowchart symbol: (1-2)
Input/Output
Output
Start/Stop
Decision
Q3: Identify the purpose of the following flowchart symbol: (1-2)
Input/Output
Sub-process
Process
Decision
Q6: Identify the purpose of the following flowchart symbol: (1-2)
Process
Input/Output
Sub-process
Decision
Q6: Identify the purpose of the following flowchart symbol: (1-2)
Process
Input/Output
Sub-process
Decision
The following algorithm should take as input on number, and output the 12 times table for that number. Identify the correct algorithm.
number = input(“Enter a number”)
for x = 1 to 12
print(number * x)
next x
number = input(“Enter a number”)
for x = 0 to 12
print(number * x)
next x
number = input(“Enter a number”)
for x = 1 to 12
print(number X x)
next x
number = input(“Enter a number”)
for x = 1 to 12
print(number * number)
next x
The following algorithm should take as input two numbers, add them together, multiply the answer by 11, add 4, then divide by 2.
It should output the result.
Identify the correct algorithm.
number = input(“Enter a number”)
number = input(“Enter the second number”)
final = (((number + number) * 11) + 4) / 2
print (final)
number = input(“Enter a number”)
number2 = input(“Enter the second number”)
final = (((number + number2) * 11) + 4) * 2
print (final)
number = input(“Enter a number”)
number2 = input(“Enter the second number”)
final = number + number2 +4 *11 / 2
print (final)
number = input(“Enter a number”)
number2 = input(“Enter the second number”)
final = (((number + number2) * 11) + 4) / 2
print (final)
