Hash table and Python dictionary

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Hash table and Python dictionary相关的知识,希望对你有一定的参考价值。

One of the most useful Python collections is the dictionary, which is an associative data type where you can store key-data pairs. It is implemented using hash tables.

Hash table is a collection of items which are stored in such a way as to make it easy to find item. Each position of the hash table, often called a slot, can hold an item and is named by an integer value starting at 0. The mapping between an item and the slot where that item belongs in the hash table is called the hash function. A perfect hash function maps every items into a unique slot. When two items hash to the same slot, collision happens. And a systematic method, which called collision resolution, for placing the second item in the hash table must be put forward.

以上是关于Hash table and Python dictionary的主要内容,如果未能解决你的问题,请参考以下文章

Python 字典

python15-day03 文件的基本操作

Python oneliner初始化字典[重复]

[leetcode] Hash Table-760. Find Anagram Mappings

剑指Offer数据结构之Hash Table和图[Python版]

剑指Offer数据结构之Hash Table和图[Python版]