码迷,mamicode.com
首页 > 编程语言 > 详细

Hash table and Python dictionary

时间:2017-06-13 18:19:12      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:cond   second   art   str   can   map   solution   ble   iat   

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

标签:cond   second   art   str   can   map   solution   ble   iat   

原文地址:http://www.cnblogs.com/techlarry/p/Hash-table-and-Python-dictionary.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!