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

> Sometimes it's as simple and silly as using a list and constantly iterating over it instead of using a dictionary/KV-map.

It's pretty easy to walk away from an algorithms course with the very basic intuitive understanding that "dictionaries trump all other data structures." Certainly that misses out on all of the cases when hash maps are a liability, e.g. when dealing with sequential data, but most questions end up being pro-dictionaries anyway.



A dictionary is an interface, not a structure.

Hashmaps, priority-queues/heap-trees, and others are all wildly different approaches of implementing a dictionary - all with their own different Big-O characteristics.




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

Search: