https://github.com/kylepw/hashtable
Hash table example in Python.
https://github.com/kylepw/hashtable
algorithms cracking-the-coding-interview hash hashtable python
Last synced: 18 days ago
JSON representation
Hash table example in Python.
- Host: GitHub
- URL: https://github.com/kylepw/hashtable
- Owner: kylepw
- License: mit
- Created: 2019-09-03T11:27:16.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-05T11:56:02.000Z (almost 6 years ago)
- Last Synced: 2025-06-25T03:03:10.149Z (18 days ago)
- Topics: algorithms, cracking-the-coding-interview, hash, hashtable, python
- Language: Python
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
=========
Hashtable
=========
Basic hash table implementation based on Cracking the Coding Interview, p. 88.Usage
-----
Like this: ::$ git clone https://github.com/kylepw/hashtable.git && cd hashtable
$ python
>>> from hash import Hashtable
>>> h = Hashtable()
>>> h.set('jimmy', 54)
Node {jimmy: 54}
>>> h.set('jasmine', 32.5)
Node {jasmine: 32.5}
>>> h.get('jasmine', 'jimmy')
(32.5, 54)
>>> h.keys()
('jimmy', 'jasmine')