
TDS Lec 7&8
Authored by Wee Yin
Computers
University
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
The complexity of Binary search algorithm is
O(n)
O(log n)
O(n2)
O(n log n)
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the time complexity of following code:
int a = 0;
for (i = 0; i < N; i++) {
for (j = N; j > i; j--) {
a = a + i + j;
}
}
O(N)
O(N*log(N))
O(N * Sqrt(N))
O(N*N)
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What does it mean when we say that an algorithm X is asymptotically more efficient than Y?
X will be a better choice for all inputs
X will be a better choice for all inputs except possibly small inputs
X will be a better choice for all inputs except possibly large inputs
Y will be a better choice for small inputs
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the main disadvantage of a binary search compared to a linear search?
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Consider this list of numbers L: 3 4 5 6 7 8 9. Which number would be checked first in a binary search?
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is meant by the time complexity of an algorithm?
7.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
What two pieces of information allow you to analyse an algorithm?
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?