3 ms·
Because the Big O notation as used by engineers is actually about practical problems and not asymptotical behavior. So integers count as constant memory AND ca
by crubier 7y ago
Because the Big O notation as used by engineers is actually about practical problems and not asymptotical behavior.
So integers count as constant memory AND can be considered to be arbitrarily large for the purpose of the current problem. Because having more than 2^64 lines in a file will never happen in practice, and even if it does then 2 integers would do the job for the rest of the observable universe.
Be pragmatic, you are on Hacker News.
- lorenzhs 7y agoUh, that's what the theory people do, too. We make assumptions about the model, for example, that if our input is of size n, a machine word should be able to store that number (word size θ(log n) bits). Otherwise we'd never get anywhere with asymptotic analysis. In my experience, practitioners just have a lot of misconceptions about "Big O".