mirror of
				https://github.com/krahets/hello-algo.git
				synced 2025-11-04 14:18:20 +08:00 
			
		
		
		
	Update hash_map.md (#641)
This commit is contained in:
		@ -552,8 +552,8 @@ index = hash(key) % capacity
 | 
			
		||||
对于上述示例中的哈希函数,当输入的 `key` 后两位相同时,哈希函数的输出结果也相同。例如,查询学号为 12836 和 20336 的两个学生时,我们得到:
 | 
			
		||||
 | 
			
		||||
```shell
 | 
			
		||||
12386 % 100 = 36
 | 
			
		||||
20386 % 100 = 36
 | 
			
		||||
12836 % 100 = 36
 | 
			
		||||
20336 % 100 = 36
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
如下图所示,两个学号指向了同一个姓名,这显然是不对的。我们将这种多个输入对应同一输出的情况称为「哈希冲突 Hash Collision」。
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user