Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

depends how big n gets in the context of that particular function. a O(2^n) can be faster real world that O(1) if the overhead of the O(1) is bigger than the O(2^n) version. Its important to remmeber that big O is a measure of worst case as n grows. If N is bounded by the realities of the business case, it might not be so bad.


big O assumes n is asymptotic and unbounded. But anyway, constant time might be more deterministic which is a good quality.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: