3 ms·
> Making those diverge is intentional obfuscation. It's not obfuscation, it's literally the definition. I'm not saying that the algorithm in question is pract
by evanpw 11y ago
> Making those diverge is intentional obfuscation.
It's not obfuscation, it's literally the definition.
I'm not saying that the algorithm in question is practical, but asymptotic complexity has a precise mathematical definition, so it's totally possible for an algorithm with "good" time complexity to be so complicated or have such a huge constant that it's impossible to use (see [1] and [2] for some examples).
It's also totally legitimate to give a constraint on additional memory size, so that this algorithm is disallowed altogether (which is probably the right answer), or change the problem so that the word size varies with the list length, but it's not legitimate to just say that the algorithm isn't linear time because the constant is too big.
[1] http://cstheory.stackexchange.com/questions/4491/powerful-algorithms-too-complex-to-implement http://cstheory.stackexchange.com/questions/4491/powerful-al...
[2] https://rjlipton.wordpress.com/2010/10/23/galactic-algorithms/ https://rjlipton.wordpress.com/2010/10/23/galactic-algorithm...
- Dylan16807 11y agoThe definition talks about what happens for extremely large numbers. It does not talk about smaller numbers at all. If you use an algorithm and complexity that are close for both moderately large numbers and extremely large numbers, you've done a good job. If you introduce dumb things like constants that are larger than the known universe, you are performing obfuscation. The suggested algorithm is linear, but only when applied to a very specific interpretation of the problem. I'm disagreeing with that interpretation of the problem, not the conclusion that it's linear within that particular interpretation.