Search Header Logo

TDS Lec 7&8

Authored by Wee Yin

Computers

University

Used 2+ times

TDS Lec 7&8
AI

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?

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?