태코놀로지

Chaining 기반의 해시 충돌 해결법에서 head 활용 이유 본문

Data Structure

Chaining 기반의 해시 충돌 해결법에서 head 활용 이유

태코놀로지 2016. 10. 13. 02:44

Simple means to resolve collision

- "Chaining": Use linked-lists. New key inserted at the head of a list.

(충돌난 hash slot에 linked-list를 이용해서 주렁주렁 이어 달자. 단 head!)


Why not inserted at the tail?

(왜 tail이 아니라, head?)


tail에 달기 위해서, tail까지 탐색이 필요한데,

search operation of linked-list takes linear time

(i.e., proportional to the size)


Comments