Search Header Logo

Analysis of Algorithm 2-Quizz(0)

Authored by Bilal Syed

Computers

University - Professional Development

Used 2+ times

Analysis of Algorithm 2-Quizz(0)
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

22 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

The complexity of Binary search algorithm is

O(n)

O(log n)

O(n2)

O(n log n)

2.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

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

30 sec • 5 pts

A linear function takes the form

f(n) = an + b

f(n) = an2 +bn + c

f(n) = alog2n

f(n) = a + b

4.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

The number of executions grows extremely quickly as the size of the input increases

Exponential Time

Linear Time

Polynomial Time

Constant Time

5.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

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

6.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Consider this list of numbers: 3 4 6 7 8 9. If the number 9 was to be found using a linear search, how many comparisons need to be made?

6
3
8
4

7.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

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

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?