What is a "Hash" and How to Build one from Scratch in Ruby
27-Oct-2021 1094
Like a lot of data structures, Ruby provides us with a ready to use class Hash, which we can use by calling Hash.new or using the hash literal {}.Like other data structures, a hash holds a collection of data, but that data is not ordered. Instead, a hash uses keys (which can be any data type), to point to it's values. Hashes also provide us lot of benefits over similar data structures (like Arrays or LinkedLists), because they provide us an O1 lookup time for access/searches, insertion, and deletion.
What is a "Hash" and How to Build one from Scratch in Ruby #ruby #rubydeveloper #rubyonrails #"Hash" #Build #Scratch https://rubyonrails.ba/link/what-is-a-hash-and-how-to-build-one-from-scratch-in-ruby