Skip to content

Conversation

leandronsp
Copy link
Contributor

@leandronsp leandronsp commented Oct 6, 2023

The first implemenation of hash table in Ruby is very simple and does not handle collisions. Now, we're adding the ability to mitigate collisions by using buckets.

The current implementation also brings a scenario of collision: in Ruby, both "code" and "mode" lead to 400 when applying the current hashing function:

irb(main):001> :mode.to_s.bytes.reduce(&:*) % 500 => 400 irb(main):002> :code.to_s.bytes.reduce(&:*) % 500 => 400 irb(main):003> 
Copy link
Owner

@kelvins kelvins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks @leandronsp 🚀

@kelvins kelvins merged commit d958907 into kelvins:main Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants