5 ms·
The complexity bound of an algorithm is the worst possible complexity. It needs to be proven (by assuming the worst possible input data), and there exists only
by yobbo 4y ago
The complexity bound of an algorithm is the worst possible complexity. It needs to be proven (by assuming the worst possible input data), and there exists only one provable bound for a particular algorithm.
Finding the complexity of an algorithm in school is an exercise for understanding algorithms, and gaining a "vocabulary" for talking about them. But, provable bounds don't correspond to practical bounds, since input data is almost never close to the worst-case scenario. It isn't really a practical skill.
Several algorithms have bad provable complexity but can perform well in practice, while algorithms with better provable complexity can perform worse on average input sets.