Search Header Logo
Algorithm Complexity

Algorithm Complexity

Assessment

Presentation

Computers

University

Medium

Created by

Shahbaz Farooq

Used 8+ times

FREE Resource

21 Slides • 21 Questions

1

Algorithm Complexity

By Shahbaz Farooq

​Big O Notation

2

Multiple Choice

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

3

Multiple Select

What two pieces of information allow you to analyse an algorithm?
1
Time Complexity
2
Space Complexity
3
Size Complexity
4
Complex Complexity
5
Simplicity Complex

4

Multiple Choice

What is space complexity?
1
The space complexity is the amount of storage space an algorithm takes up
2
How many times a certain number (base) is multiplied together to reach another number.
3
An algorithm is a series of steps that complete a task

5

Multiple Choice

What does the big-O notation show?
1
The effectiveness of an algorithm
2
The amount of time required to solve a particular problem
3
How difficult a problem is to solve
4
How many lines of code are required to solve a problem
5
How quickly a solution can be developed

6

media

What do you think ?​

7

media

8

media

9

media

10

media

11

media

12

media

13

media

14

media

15

media

16

media

17

media

18

media

19

media

20

Multiple Choice

If for an algorithm time complexity is given by O(1) then complexityof it is:

1

constant

2

polynomial

3

exponential

4

none of the mentioned

21

Multiple Choice

Question image
1

O(n)

2

O(m)

3

O(n+m)

4

O(n*m)

22

Multiple Choice

If for an algorithm time complexity is given by O(n) then complexityof it is:

1

A. constant

2

B. linear

3

C. exponential

4

D. none of the mentioned

23

Multiple Choice

Question image

What is the time complexity of this algorithm?

1

O(n)

2

O(2n)

3

O(log n)

4

O(n2)

5

O(1)

24

Multiple Choice

Question image

What is the time complexity of this algorithm?

1

O(n)

2

O(2n)

3

O(log n)

4

O(n2)

5

O(1)

25

Multiple Choice

Why is this not a sequence?

Start car

Put in key

Turn key

Drive away

1

There are spelling mistakes

2

The instructions are in the correct order

3

The instructions are in the wrong order

4

It is a sequence

26

media

27

media

28

media

29

Multiple Choice

Time Complexity of this program:

def f():

a = 0

for i = 1 to n:

a += i;

b = 0

for i = 1 to m:

b += i;

1

O(n)

2

O(m)

3

O(n+m)

4

O(n*m)

30

Multiple Choice

If for an algorithm time complexity is given by O(1) then complexityof it is:

1

constant

2

polynomial

3

exponential

4

none of the mentioned

31

Multiple Choice

If for an algorithm time complexity is given by O(n) then complexityof it is:

1

A. constant

2

B. linear

3

C. exponential

4

D. none of the mentioned

32

Multiple Choice

Indicate constant time complexity in terms of Big-O notation

1

O(n)

2

O(1)

3

O(log n)

4

O (n^2)

33

Multiple Choice

Indicate exponential time complexity in terms of big-O notation

1

O (n)

2

O (n^2)

3

O (2^n)

4

O (log n)

34

Multiple Choice

Find the slowest time complexity

1

O (n)

2

O (n^2)

3

O (n!)

4

O (2^n)

35

Multiple Choice

Which notation is consistent for every execution?

1

O (n)

2

O (n^2)

3

O (1)

4

O (2^n)

36

Multiple Choice

The O (n!) is so inefficient, there is no practical use for it

1

True

2

False

37

Fill in the Blank

Big-O is used to identify the most ____ algorithm for a specific purpose

38

Multiple Choice

O (n log n) is the worst case scenario for

1

Merge Sort

2

Bubble Sort

3

Binary Search

4

Linear Search

39

Multiple Choice

n2n^2  is the worst case scenario for

1

Merge Sort

2

Bubble Sort

3

Binary Search

4

Linear Search

40

media

41

media

42

media

Algorithm Complexity

By Shahbaz Farooq

​Big O Notation

Show answer

Auto Play

Slide 1 / 42

SLIDE