This is known as the Big O designation, it is an expression of the asymptotic complexity of a given algorithm with respect to some parameters.
- asymptotics means that we are not interested in the first few cases, but about the behavior of the algorithm with increasing size of the input parameters.
- parameters depend on the measured algorithm
- operation in which we are interested
For example, in the case of a binary search, we express a relationship between the number of comparisons performed, depending on the size of the set in which we are looking.
Runtime can usually be inferred from this, but this is not always the case, especially if you have not chosen the right "operation" in terms of implementation or hardware limitations.
A few days ago, there was a good article on sorting using tape as storage. Since the difficulty in the search expresses the number of comparisons and the use of the tape as storage, the runtime mainly depends on the movement of the tape ... it turned out that the bubble system will work better than quicksort, despite the fact that in general it is described as slower.
source share