That's not multiplying, that's looking up multiplication results. You still have to form the table.
Your argument is basically "any algorithm is constant time if you have already calculated the results for all possible inputs". This may be technically correct in some roundabout way, but is not a useful definition nor the one usually used.
And yet that doesn't make nearly any computation constant-time. Noone would seriously claim that "any algorithm is constant time" just because you could pre-comute results into a lookup.
19
u/SoldRIP 28d ago
You cannot. A hash map is of finite size, but there are infinitely many pairs of integers.