Iridescent
Iridescent copied to clipboard
Hash表的问题
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,是有问题的
抱歉,之前看到了但一直忘记回复了。我看了下代码,确实会有你说的问题,我之后会改一下。谢谢~
谢谢,我已经改了