3 ms·
Textbooks, and especially undergraduate textbooks, tend to favor conceptual simplicity over performance and ease of implementation. They are supposed to teach y
by jltsiren 5y ago
Textbooks, and especially undergraduate textbooks, tend to favor conceptual simplicity over performance and ease of implementation. They are supposed to teach you the key ideas behind the techniques rather than the complicated details of how things work in the real life.
The fundamental idea of a hash table is that you turn the key into a hash value and then store the key in the bucket corresponding to the hash value. The simplest way of dealing with hash collisions is assuming that each bucket is a concrete data structure capable of storing multiple keys. With this conceptual model, you already understand the essence of how hash tables work and when it's the appropriate data structure to use.
Open addressing is a more advanced topic. Undergraduate data structure classes usually mention it, but many students don't have the prerequisites (such as probability and memory hierarchies) to understand it or to make informed choices about it. After all, basic data structures is an early class, typically taught after introductory programming but before the core CS classes that rely on it.