Implementing a Hash Table in Ruby

Joe Gelay
Joe Gelay
May 5, 2020 · 5 min read
Photo by Nick Fewings on Unsplash

Hash tables are an instrumental data structure for storing relationships between large amounts of data. When designed correctly, they can offer the access efficiency of an array, and the search, insertion, and deletion efficiency of a hash (all constant time). Hash tables achieve this by storing values in an array with indices that correlate to the stored value’s hash code which is generated by a hash function. We’ll walk through…