A means to describe the efficiency of algorithms.
O refers to the 'order' of the function (the growth rate of its operations)
The algorithm is as efficient as the size of its data. Also known as 'Linear'.
i.e. algo([1,2,3])
will operate 3 times.
This algorithm is increasing its operations n * n
. Also known as 'Quadratic'.
i.e. algo([1,2,3])
will make 3 * 3 operations, 9.
This algorithm increases its operations logarthimically log n
. Also known as 'Logarithmic'.
O(log n) operates less times than the dataset's size.
This is apparent in classic binary search algorithms where the dataset continuously halved.
This is the average complexity of a quicksort algorithm where the dataset is continuously partitioned.