Why Isn't Every Data Type Hashable?

preview_player
Показать описание

Please check my playlists for free DSA problem solutions:

Best Courses for Analytics:
---------------------------------------------------------------------------------------------------------

Best Courses for Programming:
---------------------------------------------------------------------------------------------------------

Best Courses for Machine Learning:
---------------------------------------------------------------------------------------------------------

Best Courses for Statistics:
---------------------------------------------------------------------------------------------------------

Best Courses for Big Data:
---------------------------------------------------------------------------------------------------------

More Courses:
---------------------------------------------------------------------------------------------------------

Full Disclosure:
Please note that I may earn a commission for purchases made at the above sites! I strongly believe in the material provided; I only recommend what I truly think is great. If you do choose to make purchases through these links; thank you for supporting the channel, it helps me make more free content like this!
Рекомендации по теме
Комментарии
Автор

Master Data Structures & Algorithms For FREE at AlgoMap.io!

GregHogg
Автор

It is a common question for Java interviews, regarding HashMap class, and why hashcode fn always have to return the same valeu.

brunomillerps
Автор

which is why you hash the pointer to the array, not the contents.

AllanSavolainen
Автор

Frozen array haha, that is great perfectly explains what a tuple is.

Supakills
Автор

I would argue, since we can hash current representation of an array, and we can consider any changes of array as creating completely new array, thus, different result in hash

cgulbhw
Автор

What about using vector as key in maps C++. Vector is a key that will be hashed right?

rahulsanjay
Автор

Im a little confused on what is happening here.
From my understanding, the only thing that goes through the hash function is a key. Why would anyone use an array as a key? Doesnt using a key that can change defeat the purpose of a hash map?
Can you explain why this is even important?

ragama
Автор

I mean, is that wrong? Do you want, even if stored at the same place, to have a diferent list be equal? I mean, sure the pointer is the same, but the contents aren't, when using hash maps you mainly want to == compare them, and not is compare.

rodrigoqteixeira
Автор

Now i understand mutable and immutable variables ❤❤❤

its_code
Автор

What about Set? I thought they're mutable and hashable?

okorochaobinna