Big - O Flashcards

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

What is Big-O?

A

Big-O notation is an assessment of an algorithm’s efficiency. Big-O notation helps gauge the amount of work that is taking place.

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

What does the Big-O notation look like for:

1) constant
2) logarithmic
3) linear

A

1) O(1)
2) O(log2 N)
3) O(N)

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

What does the Big-O notation look like for:

1) linearithmic
2) quadratic
3) exponential

A

1) O(N log2 N)
2) O(N2)
3) O(Nn)

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

Why do we need to know the Big-O Notation?

A

One of the main reasons for consulting Big-O is to make decisions about which algorithm to use for a particular job.

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

How do you apply a Big-O notation?

A

In order to properly apply a BigO notation, it is important to analyze a piece of code to see what the code is doing and how many times it is doing it.

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

What’s the formal defintion for Big-O?

A

BigO is bound(N) if runTime(N) <= c * bound(N)

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

What are some things to consider then determining the Big-O?

A

It’s determined by the most restrictive Big-O possible so that the Big-O grows at a faster rate than the actual runtime of the code.

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