3 ms·
The language doesn't matter, nor even it's high vs low class. You can write a short function in any language that looks O(1) if you only look at the surface or
by Brian_K_White 6y ago
The language doesn't matter, nor even it's high vs low class.
You can write a short function in any language that looks O(1) if you only look at the surface or high level of it. Even assembly. Meanwhile in the middle of that routine is a single call to another function or macro which may be 0(1) or O(n!).
Python was just an example.
- a1369209993 6y ago> Even assembly. Although high-level languages like python or to a lesser but less excusable degree C++ are more susceptible to this because more features can secretly be greater-than-constant-time function calls.