What is a Big O Notation
Big O Notation short explain
Definition of Math line
f(x) = O(g(x)) as x -> ∞
Definition of Computer line
Big O Nation is worst time or the area which most processors. The computer must be paid to run the algorithm or the complexity of algorithm
For example, there is an array containing 10 unique name ( we have our own name). Let’s say we want to find a name for ourselves. We need to loop to find the righ one. If we are lucky We are in the first position. It take about 1 loops, but unfortunately … To the last position It takes about 10 loops to find what you want. The worst case is that we are interested and call it Big O Nation.
Data 1–10 is not different, If the amount of data increased by 1M+, then we unfortunately have the worst case. the computer it loops around a million of them. But we can reduce the chance of it happening Using Big O Notation analysis.
Types of Big O Notation
There are about 8 types. The Big O Notation called O(n) When n is the number of inputs in our algorithm. Big O Notation focuses on the subject. Processing time.
O(1) or Constant
O(log n) or logarithmict
O(n log n) or linearithmic
O(n²) or quadratic
O(n³) or cubic
O(2^n)or exponential
O(!n) or factorial