Complexity Problems Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

time complexity of an algorithm can be expressed as

A

a polynomial.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

To compare the two algorithms, we can

A

compare the respective polynomials.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The asymptotic notation compares two functions, say

A

f(n) and g(n)

for very large values of n.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

One of the asymptotic notations is the

A

Big O notation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Once we have obtained the time complexity of an algorithm by counting the number of primitive operations, we can arrive at the Big O notation for the algorithm simply by:

A

Dropping the multiplicative constants with all terms
Dropping all but the highest order term

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

constant coefficients have become insignificant in the Big-Oh notation

A

unless both functions have the same order

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

constants represent the number of —— on a given line of code.

A

primitive operations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What matters in the the Big-Oh notation is

A

correctly counting the number of times each line of code is repeated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

how Big-Oh notation is done?

A

by just counting the number of executions of each line of code, instead of the number of operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

time complexity involves other types of functions like

A

<in>
Constant
Logarithmic
Log-square
Root-n
Linear
Linearithmic
Quadratic
Cubic
Quartic
Exponential
Exponential
n-Factorial
</in>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

in the ascending order of rate of growth Any function can be given as Big O of any other function that appears ——

A

later

How well did you know this?
1
Not at all
2
3
4
5
Perfectly