5 ms·
Interesting that the author offers the chained hash table as an alternative implementation - that was always how I was taught they worked back in school. (1986?
by saw-lau 10y ago
Interesting that the author offers the chained hash table as an alternative implementation - that was always how I was taught they worked back in school. (1986?)
- douche 10y agoSame here, graduated in the 2000s. The way hash tables are described in the opening section sounds really naive, and I would hope that real implementations aren't using that method.
- emodendroket 10y agoAFAIK most real-world dictionary classes use linear probing.
- gpderetta 10y agostd::unordered_map and friends use chaining (and they suffer from it).
- mason55 10y agoGo find the post on the history of dict in Python from the other day to see how they move away from chaining.
- emodendroket 10y agoThat's because that implementation is more obvious but has worse real-world performance than linear probing.