Different computers have different processing powers and therefore can handle certain tasks at different speeds, this makes it useless to test the efficiency of a function/program based on its runtime on a single machine. Instead, algorithm efficiency is analysed based on the variation in resource use as the size of the processed input (n) varies. The runtime is calculated in relation to the input size (n) and is simplified to the highest degree. This is expressed in Big-Oh notation "O(n)". The big-Oh notation is used as a universal measure of the efficiency of a function regardless of machine power.
There are different implementations of sorting algorithms that differ in structure, built-in-function use and runtime efficiency. Some algorithms are more efficient than others with inputs of a smaller size and vice versa. Their efficiencies are recorded in Big-Oh notation based on a variety of inputs of different size (n).
There are different implementations of sorting algorithms that differ in structure, built-in-function use and runtime efficiency. Some algorithms are more efficient than others with inputs of a smaller size and vice versa. Their efficiencies are recorded in Big-Oh notation based on a variety of inputs of different size (n).