[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lua string
- From: Ralph Hempel <rhempel@...>
- Date: Sat, 28 Apr 2007 23:13:08 -0400
Roberto Ierusalimschy wrote:
Philippe Lhoste wrote:
I disagree. What you call "same algorithm" is actually a naive rewriting
of a language idiom into another language.
Respectfully, that's *why* it's the same algorithm. If you rewrote it to use a
more appropriate language idiom, it would be a different algorithm, more or
less by definition.
I may be wrong, but as far as I know time complexity is an intrinsic
property of an algorithm. So, if something runs in O(n) and something
else runs in O(n^2), they cannot be the same algorithm.
I think we're running into the gap between the semantics of the
test code and how the test code is actually implemented in the
system being tested.