Hacker News new | ask | show | jobs
by volkk 1975 days ago
Should also add that an inefficient solution for a mostly fixed input size is still going to be efficient. If you have to write a double for loop but the outer loop is iterating on a 1000 element array and the inner one is operating on a 26 element array (e.g alphabet), it's still a fast and probably good enough solution.
1 comments

Operating on a fixed size datatype is trivially O(1), too (because O(c) = O(1) when c is a constant).