It is quite reasonable to limit the average case O to the most common inputs with the caveat that it can be worse otherwise. It’s not like every arithmetic operation is counted as O(n) in Python for example as you aren’t expected to use numbers larger than 2^32 often
Comment on I also have one
Lysergid@lemmy.ml 1 week agoI mean, if structure is O(1) for low N, it’s still O(1) for high N. If O “changes” from 1 to N with size then it’s never been 1. All I’m saying > “if it’s big” is not how you identify correct O
Lojcs@piefed.social 1 week ago
hirihit640@sh.itjust.works 1 week ago
I only put “if it’s big” to help readers imagine a large pile and how it would become more inconvenient the larger the pile. Language is not as precise as math or programming. If you’d like you can imagine the sentence as saying something like “imagine a big pile. It’s definitely not O(1)”