資料結構›Ch8 雜湊第 30 題/共 37 題
30. Hash Function、碰撞
#DS-08-030易Hash Function碰撞
(10%) Assume that you have to store the four strings: "abcdef", "bcdefa", "cdefab", and "defabc", in the hash table by using the hashing technique.
(1) (5%) Consider the hash function: the index for a specific string will be equal to the sum of the ASCII values of the characters modulo 11. Please determine how many collisions if we use this hash function.
(2) (5%) Consider the hash function: the index for a specific string will be equal to sum of ASCII values of characters multiplied by their respective order in the string after which it is modulo with 11. Please determine how many collisions if we use this hash function.
Note: The ASCII values of a, b, c, d, e, and f are 97, 98, 99, 100, 101, and 102 respectively.
📄 成大110
▤完整推導請見《WH 資工筆記 · 資料結構》Ch8 雜湊