Analysis of Algorithm 2-Quizz(0)

Analysis of Algorithm 2-Quizz(0)

University - Professional Development

22 Qs

quiz-placeholder

Similar activities

DSA - Q1

DSA - Q1

University

25 Qs

Quiz on Standard Algorithms

Quiz on Standard Algorithms

10th Grade - University

20 Qs

Algorithm Analysis

Algorithm Analysis

University

21 Qs

Data Structures

Data Structures

University

20 Qs

Analysis Algorithms Introduction

Analysis Algorithms Introduction

University

26 Qs

Quantitative Aptitude Series

Quantitative Aptitude Series

University

20 Qs

2 Big oh

2 Big oh

University

20 Qs

Linked list 1

Linked list 1

University

20 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?