シリウスの砂

Home

❯

公开课

❯

CS61B

❯

Data Structure

❯

Hashing

Hashing

✏️ Jan 17, 2026🔧 Dec 25, 2025📄 Jan 17, 20261 min read

Using Data as Index

Implementation

Prototype

Advance

Generalizing to Other Than Integer

Method:(二进制编码法)

Perceiving strings as a number with base 27(because of 26 letters)

Improvement

Problem

Handling Collisions

(Buckets)

Modulo primes:为什么哈希函数要模质数 What if modulo a negative number?

Runtime:

Hash Table

Math.floorMod is more recommended because it can handle negative hashCode.

Hash Function

31 is usually used.

Why hashCode must be overridden before equals?


关系图谱

  • Using Data as Index
  • Implementation
  • Prototype
  • Advance
  • Generalizing to Other Than Integer
  • Hash Table
  • Hash Function

反向链接

  • ADTs

Created with Quartz v4.5.2 © 2026

  • GitHub@Siriusuna
  • X@Salieri1122
  • Mail@Siriusuna