3 ms·
> The theoretical complexities are: > - For list: O(n) > - For vector: O(n) > Surprisingly enough, the vector version is almost 90 times faster than the list
by yes_really 4y ago
> The theoretical complexities are:
> - For list: O(n)
> - For vector: O(n)
> Surprisingly enough, the vector version is almost 90 times faster than the list version for 8K. How can we explain this big difference?
That does not contradict the theoretical complexities at all. The article didn't show any "practical" complexities contradicting the theoretical ones.
I do not mean to offend, but it looks like the author doesn't even understand what the O() notation means. The notation does not imply that all O(n) functions take the same amount of time. Multiple functions can scale linearly and still be different. In fact O(n) = O(1,000,000*n).