D
Dann Corbit
Tom St Denis said:I don't see the problem here. The algorithm has a complexity of O(n^2)
whether that is space or time it's still that complex.
If an algorithm finishes in a fixed time and never takes more than a limited
number of clocks to complete, then it is a constant time algorithm. That's
the definition. I am talking about a hardware multiply of a hardware
integer on some C implementation.
Why do things get more efficient as you use more resources?
There is no claim on my part of increased efficiency with greater resources.
Different SIZED NUMBERS. Yes, in fact the size grows quadratically
with the size of the input if you want to keep O(1) time.
All the integers involved are 64 bit (or less). The algorithm I supplied
(and the one that you supplied) do not use variable sized registers or
numbers. It is an implementation that uses integers of a single, constant
size.
What? You think a 16-bit and 64-bit multiplier are the same size for
constant time?
In what way does the implementation that you supplied change the size if its
registers as it runs? The answer is, 'the integers in this algorithm are
all of the same size and they do not change width during the operation of
the algorithm'.
I think that a 64 bit hardware number uses an ALU and mutiplies in constant
time.
I have not made any claims about changing the size of the multiplier.
The algorithm that YOU supplied uses a constant sized hardware integer.
I think that you are smart enough to know that you are wrong. If not, then
I don't see any point in continuing the discussion.
It's OK to be wrong. I'm wrong a lot. But when you are wrong and you know
you are wrong and you insist that you are right it looks pretty strange.
[snip]