TDS Lec 7&8

TDS Lec 7&8

University

10 Qs

quiz-placeholder

Similar activities

Time and Space Complexity

Time and Space Complexity

University

15 Qs

DAA Quiz 1

DAA Quiz 1

University

10 Qs

ADA QUIZZZZZ 2nd Time

ADA QUIZZZZZ 2nd Time

University

10 Qs

Algorithms and algorithmic Complexity

Algorithms and algorithmic Complexity

University

10 Qs

AdvancedProgramming_intro

AdvancedProgramming_intro

University

10 Qs

Algorithm Complexity Final Exam

Algorithm Complexity Final Exam

University

15 Qs

Analysis of Algorithms

Analysis of Algorithms

University

10 Qs

Fundamentals of Algorithms - Unit 1 - Test 1

Fundamentals of Algorithms - Unit 1 - Test 1

University

15 Qs

TDS Lec 7&8

TDS Lec 7&8

Assessment

Quiz

Computers

University

Hard

Created by

Wee Yin

Used 2+ times

FREE Resource

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?
It requires the data to be in order
It requires more memory
It does not execute as quickly with larger data sets
Not all CPUs are capable of executing the algorithm

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
3
9
4

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is meant by the time complexity of an algorithm?
The amount of time required to solve a particular problem
How difficult a problem is to solve
How many lines of code are required to solve a problem
How quickly a solution can be developed

7.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

What two pieces of information allow you to analyse an algorithm?
Time Complexity
Space Complexity
Size Complexity
Complex Complexity
Simplicity Complex

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?