Yay Big O Notation! :)

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/37

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

38 Terms

1
New cards

Indicate constant time complexity in terms of Big-O notation

O(1)

2
New cards

Indicate exponential time complexity in terms of big-O notation

O(2^n)

3
New cards

Find the slowest time complexity

O(n!)

4
New cards

Which notation is consistent for every execution?

O(1)

5
New cards

Which notation grows in proportion to the size of the input

O(n)

6
New cards

Which notation would you usually use for a nest loop?

O(n²)

7
New cards

Indicate polynomial time complexity in terms of big-O notation

O(n²)

8
New cards
term image


1 + 3n + n

9
New cards
<p><span>Which line best represents the time complexity n!</span></p>

Which line best represents the time complexity n!

Red

10
New cards
<p><span>Which line best represents the time complexity log n</span></p>

Which line best represents the time complexity log n

Orange

11
New cards
<p><span>Which line best represents the time complexity n</span></p>

Which line best represents the time complexity n

Pink

12
New cards

The complexity of Bubble sort algorithm is

O(n²)

13
New cards

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

Constant

14
New cards

The linear/sequential search method to search an element in an array has the complexity of Big(O)?

n

15
New cards

The last index value of an array can be accessed by

array [array.length - 1];

16
New cards
<p><span>What is the time complexity of following code</span></p>

What is the time complexity of following code

O(log N)

17
New cards

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

linear

18
New cards

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

Constant

19
New cards

To measure Time complexity of an algorithm Big O notation is used which:


describes limiting behavior of the function

characterizes a function based on growth of function

upper bound on growth rate of the function

all of the mentioned

all of the mentioned

20
New cards

Big-O notations tell you how long the algorithm will take to complete in standard time

True

False

False

21
New cards

The number of executions grows in proportion to the size of the input

Exponential Time

Linear Time

Polynomial Time

Constant Time

Linear Time

22
New cards

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

Exponential Time

Linear Time

Polynomial Time

Constant Time

Exponential Time

23
New cards

The number of executions grows quickly by the input being multiplied by the input

Exponential Time

Linear Time

Polynomial Time

Constant Time

Polynomial Time

24
New cards

What two pieces of information allow you to analyse an algorithm?

Time Complexity

Space Complexity

Size Complexity

Complex Complexity

Simplicity Complex

Time Complexity

Space Complexity

25
New cards

What does a linear time complexity mean?

  • The amount of time taken to complete an algorithm is independent from the number of elements inputted.

  • The time taken to complete an algorithm will increase at a smaller rate as the number of elements inputted.

  • The amount of time taken to complete an algorithm is proportional to the number of items inputted to the power of n

  • The amount of time taken to complete an algorithm is proportional to 2 to the power of the number of items inputted.


The amount of time taken to complete an algorithm is independent from the number of elements inputted.

26
New cards

What is space complexity?

The space complexity is the amount of storage space an algorithm takes up

How many times a certain number (base) is multiplied together to reach another number.

An algorithm is a series of steps that complete a task

The space complexity is the amount of storage space an algorithm takes up

27
New cards
<p><span>What order of complexity does this graph represent?</span></p>

What order of complexity does this graph represent?

Polynomial

28
New cards
<p><span>What order of complexity does this graph represent?</span></p>

What order of complexity does this graph represent?

Logarithmic

29
New cards
<p><span>What order of complexity does this graph represent?</span></p>

What order of complexity does this graph represent?

Linear

30
New cards
<p><span>What order of complexity does this graph represent?</span></p>

What order of complexity does this graph represent?

Exponential

31
New cards
<p><span>What order of complexity does this graph represent?</span></p>

What order of complexity does this graph represent?

FConstant

32
New cards
<p><span>What is the time complexity of this algorithm?</span></p>

What is the time complexity of this algorithm?

O(n)

33
New cards
<p><span>What is the time complexity of this algorithm?</span></p>

What is the time complexity of this algorithm?

O(n²)

34
New cards
<p><span>What is the time complexity of this algorithm?</span></p>

What is the time complexity of this algorithm?

O(1)

35
New cards
<p><span>What is the time complexity of this algorithm?</span></p>

What is the time complexity of this algorithm?

O(2^n)

36
New cards
<p><span>What is the time complexity of this algorithm?</span></p>

What is the time complexity of this algorithm?

O(log n)

37
New cards

What is the Big-O Notation of "Divide & Conquer" Algorithms?

O(log n)

38
New cards

What is the Big-O Notation of a combination lock with 4 digits, each digit having 1 of 10 possible values?

O(10^n)