python - What is the true difference between a dictionary and a hash table? -
i've used dictionaries. write in python.
a dictionary general concept maps keys values. there many ways implement such mapping.
a hashtable specific way implement dictionary.
besides hashtables, common way implement dictionaries red-black trees.
each method has it's own pros , cons. red-black tree can perform lookup in o(log n). hashtable can perform lookup in o(1) time although can degrade o(n) depending on input.
Comments
Post a Comment