NEW
Font size
S
M
L
XL
WorksheetsACP Theory 1.1
Total questions: 20
Worksheet time: 10mins
Name
Class
Date
1.
The efficiency of linear search is ___.
a)
O(n)
b)
O(lg2 n)
2.
The efficiency of binary search is ___.
a)
O(lg2 n)
b)
O(n lg2 n)
3.
The efficiency of bubble sort is ___.
a)
O(n lg2 n)
b)
O(n2)
4.
The efficiency of insertion sort is ___.
a)
O(n lg2 n)
b)
O(n2)
5.
The efficiency of quick sort is ___.
a)
O(n lg2 n)
b)
O(n2)
6.
Which of the following is selection?
a)
A sequence of program instructions that functions just like a computer program.
b)
A query/condition made to direct the program to perform accordingly
.
7.
Which of the following is iteration?
a)
A query/condition made to direct the program to perform accordingly
.
b)
The act of repeating a process to achieve a specific end goal.
8.
What is a difference between while-do and do-while/repeat-until loops?
a)
While-do loops occur at least once but do-while loops occur zero or more times.
b)
While-do loops occur zero or more times but do-while loops occur at least once.
9.
What is a difference between while-do and do-while/repeat-until loops?
a)
While-do loops evaluate the expression at the end but do-while loops evaluate the expression at the start.
b)
While-do loops evaluate the expression at the start but do-while loops evaluate the expression at the end.
10.
Which of the following is a subroutine?
a)
The act of repeating a process to achieve a specific end goal.
b)
A reusable subprogram instructions that performs a specific task.
11.
What is a function?
a)
A subroutine which returns a value to its calling program.
b)
A subroutine that does not return a value.
12.
What is a procedure?
a)
A subroutine which returns a value to its calling program.
b)
A subroutine that does not return a value.
13.
A local variable is ___.
a)
A variable declared and is only accessible within a subroutine.
b)
A variable which is accessible throughout the main program and all subroutines
.
14.
A global variable is ___.
a)
A variable declared and is only accessible within a subroutine.
b)
A variable which is accessible throughout the main program and all subroutines
.
15.
Which is a difference between global and local variables?
a)
The lifetime of global and local variables are different
.
b)
The data contained in global and local variables are different.
16.
Which of the following does not describe recursion?
a)
It requires a terminating case.
b)
It mimics human logical approach to solve a problem.
17.
Which of the following does not describe iteration?
a)
It requires a terminating condition.
b)
It can generate an unbounded sequence of outcomes
.
18.
What is the difference between recursion and iteration?
a)
Recursion requires less memory than iteration.
b)
Recursion requires more memory than iteration.
19.
When will recursion be preferred over iteration?
a)
When the problem can be decomposed into smaller similar sub-problems.
b)
When the code is required to run a very large number of times.
20.
When will iteration be preferred over recursion?
a)
When the code needs to be elegant and concise.
b)
When there is scarce memory resources.
Reset
