Programming Challenges - 24 - Generic Hash Maps in C (C/C++)

preview_player
Показать описание
In this challenge, we implement a data structure to map keys to values of any type in C without templates.

Рекомендации по теме
Комментарии
Автор

Love this video, thank you for taking the time to do this.
Also, I think the hmap_put() function @33:09 is incorrect.
For instance if we put in a value with a hash of 10 as the first entry in a bucket, and then a hash
of 2 goes into the same bucket, then it will come after 10 instead of before it.
I think to solve this we need to add a check to see if the new hash is the head, and then also
change the while condition on line 94 to if (current->next && hash > current->next->hash)

Again, thank you. These videos are great. Have a good one.

rickperez
welcome to shbcf.ru