2.?.? (Big O Notation) Flashcards

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

What is the Big O Notation?

A
  • A measure of the complexity of an algorithm
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is O(1) - Constant?

A
  • The operation will always take the same amount of time, regardless of the data set
  • Straight line graph with no gradient
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is O(n) - Linear?

A
  • The operation time will increase proportionally as the data set increases
  • Straight line graph with any gradient -O(3n)- but is always simplified to O(n)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is O(n^2) - Polynomial?

A
  • The operation complexity is the square of the size of the data set
  • Right side of a quadratic graph
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is O(2^n) - exponential?

A
  • The operation complexity doubles with each item of data added
  • Right side of an exponential graph
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is O(log n ) - Logarithmic?

A
  • The operation complexity grows very slowly as the data set increases
  • Always in base 2
  • Graph increases then plateaus
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is O(n!) - Factorial?

A
  • The operation complexity grows very quickly as the data set increases
  • e.g. brute force password cracking
  • Graph increases at a steep gradient
How well did you know this?
1
Not at all
2
3
4
5
Perfectly