해시 테이블

해시 함수를 통한 O(1) 조회의 키-값 저장소.

A hash table (or hash map) is a structure that can map keys to values. A hash table uses a hash [function](/ko/terms/hash-function) to compute an index into an array of buckets or slots, from which the desired value can be found. In an ideal case, the hash function will assign each key to a unique bucket, but most hash table designs employ some form of collision resolution.

        graph LR
  Center["해시 테이블"]:::main
  Rel_index_database["index-database"]:::related -.-> Center
  click Rel_index_database "/terms/index-database"
  Rel_relational_database["relational-database"]:::related -.-> Center
  click Rel_relational_database "/terms/relational-database"
  Rel_object["object"]:::related -.-> Center
  click Rel_object "/terms/object"
  classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
  classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
  classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
  classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
  linkStyle default stroke:#4b5563,stroke-width:2px;

      

🧠 지식 테스트

1 / 1

🧒 5살도 이해할 수 있게 설명

식당의 보관소를 상상해 보세요. 코트를 맡기고 번호표를 받습니다. 번호를 주면 바로 그 위치로 갑니다. 해시 테이블은 키에서 그 '번호'를 계산합니다!

🤓 Expert Deep Dive

완벽 해싱(Perfect hashing). 뻐꾸기 해싱(Cuckoo hashing). 로빈 후드 해싱. 일관된 해싱(Consistent hashing - 분산 캐시용). 블룸 필터.

📚 출처