Big O Notation
What is Big O Notation
Speed of an algorithm is affected by the size of the input. As the size of the input increases, the 1 - Web Dev/Time Complexity increases.
a = [...]
N = 10000 000
B₁ => 1 + a[o] : time complexity: constant time, size of input (n) increases, the speed remains constant. hard to achieve, O(1)
B₂ => sum(a): time complexity: linear time, iterations through the array (a) in the sum function as there are elements in the array (N), O(N)
B₃ => pair(a): time complexity:
Change of speed of an algorithm is a mathematical concept called 1 - Web Dev/Asymptotic Analysis.