Hacker News new | ask | show | jobs
by vlovich123 896 days ago
Just because they are general and are relevant to almost every problem, doesn’t mean there aren’t traits you need to be aware of that might be relevant to your problem.

It’s like the Microsoft Word problem. 10% of functionality is used by everyone (eg saving a file, opening a file, changing the font). Those are baseline “everyone should know this”. The remaining 90% is still valuable and used by distinct subsets of customers. If Microsoft started deprecating the long tail of features without careful cohort analysis they’d start losing swathes of customers.

So for the most common operations of the most common structures I’d expect memorization of complexities just because of repetition of use (or deriving/guessing it from first principles cause it’s easy for the most common ones). But there’s much more traits and it would be important to understand that (eg what are the primary drivers of CPU time when accessing a hash map? An array? A linked list?).

1 comments

What you describe are relatively niche or uncommon uses of these algorithms and data structures. Further, the specific implementation details of a given algorithm become relevant in these contexts. Different implementations of a hashtable can lead to substantially different operational performance, and no textbook understanding (including the toy implementations performed as part of a CS curriculum, for example) of what a hashtable is will lead to the kind of understanding you discuss.
Of course. That’s why good libraries will describe the specific implementation. Not just hash table but whether or not there’s open or closed addressing, how buckets are chosen (eg cuckoo hashing, Robin Hood, etc). A text book implementation is simply meant to give you a starting point understanding of the design space but you need continuing education to become more of an expert to understand when this stuff matters. But this expertise is valuable across problem domains and levels up your technical expertise. At my level all the engineers I’ve ever interacted with have a solid grounding in the fundamentals.