Analysis of Algorithm 2-Quizz(0)

Analysis of Algorithm 2-Quizz(0)

University - Professional Development

22 Qs

quiz-placeholder

Similar activities

DS- UNIT-1

DS- UNIT-1

University

20 Qs

Sorting algorithms I

Sorting algorithms I

University

21 Qs

DATA STRUCTURES QUIZ-1

DATA STRUCTURES QUIZ-1

University

23 Qs

QUIZ

QUIZ

University

25 Qs

DSA_Prelim Quiz

DSA_Prelim Quiz

University

25 Qs

ADA LAB

ADA LAB

University

20 Qs

Computer Graphics

Computer Graphics

University

20 Qs

Section J Exam

Section J Exam

University

19 Qs

Analysis of Algorithm 2-Quizz(0)

Analysis of Algorithm 2-Quizz(0)

Assessment

Quiz

Computers

University - Professional Development

Hard

Created by

Bilal Syed

Used 2+ times

FREE Resource

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

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?