|
|
|
|
|
by quickthrower2
1030 days ago
|
|
Maybe not! With O(log N) such as binary search you are assuming some sort of structure to the data. It is not necessary for an algorithm to scan (otherwise O(N) is as good as it would get) What if we devise a data structure that becomes more efficient as it grows to do a certain (perhaps useless - but that is OK!) operation. For example we have a data structure at N=0 with a million disconnected nodes and one of them being the target node. As N increases add a node with a pointer to the target node. The algorithm to find the target node is a random search through nodes until it finds one with a pointer then halts. As N increases, time on average decreases with complexity O(1-N/(N-K)) where K=1000000 |
|
All algorithms have a lower-bound on runtime of 1. If a sequence is decreasing and bounded below, it converges to a value [1]. If the sequence is discrete, that means it reaches exactly that limit and never deviates from it.
[1] https://en.wikipedia.org/wiki/Monotone_convergence_theorem