2 ms·
As I vaguely recall, even Plain Old Array accesses take logarithmic time on real machines. However, if we don't use bignums, they're effectively constant time.
by calibraxis 12y ago
As I vaguely recall, even Plain Old Array accesses take logarithmic time on real machines. However, if we don't use bignums, they're effectively constant time.
Furthermore, it's common to "lie" in computer science. Knuth wrote: "Another noteworthy characteristic of this manual is that it doesn't always tell the truth ... The author feels that this technique of deliberate lying will actually make it easier for you to learn the ideas. Once you understand the simple but false rule, it will not be hard to supplement that rule with its exceptions."
Particularly since O(..) notation is generally used in reference to MODELS, not real machines.
But in any case, Clojure's "effectively constant" is obviously correct.
- billsix 12y ago> As I vaguely recall, even Plain Old Array accesses take logarithmic time on real machines. How does adding an offset to a pointer and referencing that data require logarithmic time? >. However, if we don't use bignums, they're effectively constant time. What are these bignums that are used for array access on "real machines"?