Re:Needed 1+1, Built a Functional Programming Language
by moregrist on Wednesday September 30, 2026 @03:25AM
(#49905577)
In a trivial sense, arrays are hash tables with a hash function of the identity f(x)=x.
It’s just not particularly common (or helpful) to view them that way.
Re:Needed 1+1, Built a Functional Programming Language
by dprkh on Thursday October 01, 2026 @06:28PM
(#49927803)
In LeetCode, it's a very common optimization. If your key values are dense, you use an array. If your key values are sparse, you use a dict.
Maybe in JavaScript... but there is a topic called datastructures, where arrays are arrays, and hashtables are hastables. If people say this without a flip of an eye I'm not surprised why people write stuff like
> I thought that hash tables were something that were basically impossible to make in C