Hacker News new | ask | show | jobs
by ForkMeOnTinder 933 days ago
Sure, if you ignore the n in n=10000, multiplication is O(1). But the same is true for e.g. heapsort--all lists of 10000 items take asymptotically the same amount of time to sort.

But that's a strained interpretation of complexity, and not very useful.

1 comments

A heapsort is designed to take a variable number of items at runtime for given code. The n is fixed at compile time in the multiplication examples and is invariant at comptime (in zig).