Iridescent icon indicating copy to clipboard operation
Iridescent copied to clipboard

Hash表的问题

Open LTitan opened this issue 3 years ago • 2 comments

def insert(self, key, value): index = self.hash_code(key) head = self.table[index] if not head: # 如果哈希表对应位置还是空的 self.table[index] = listNode(key, value) else: while head.next: head = head.next head.next = listNode(key, value) 这里insert重复的key,是有问题的

LTitan avatar Jan 26 '22 08:01 LTitan

抱歉,之前看到了但一直忘记回复了。我看了下代码,确实会有你说的问题,我之后会改一下。谢谢~

wolverinn avatar Apr 12 '22 14:04 wolverinn

谢谢,我已经改了

wolverinn avatar Apr 12 '22 14:04 wolverinn