Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
kevingadd
· 6y ago · 0 comments
If your strings are short that's basically O(1), which could be nice for some workloads - enums, json keys, etc.
Comments
[–]
jacwah
6y ago
That's not what O(1) means. If your strings are short, complexity doesn't matter either way.
[–]
leetcrew
6y ago
if all your strings are of size < c, you can do any string operation on a single string in constant time.
[–]
saagarjha
6y ago
There are certain (randomized) operations that you can’t…
[–]
admax88q
6y ago
That's still misleading.
If all my input is small then O(n^2) is basically O(1) as well.
[–]
naniwaduni
6y ago
Everything is O(1) when you have finite bounded input.