Python implementation of java TreeMap. Hope similar data structure can be added to python offical library.
Project description
HashHeap
Python's implementation of java's TreeMap. Hope similar data structure can be added to python offical library.
Install
- Install via
$ pip install HashHeap
.
How to use
-
$ from HashHeap import HashHeap
.def init(self, desc=False): '''Initalize hashheap.
:input: desc, ture for min heap, flase for max heap.
:type: bool '''def size(self): '''Get the size of the hashheap.
:input: None :type: None :return: Size of the hashheap :type: int '''def push(self, item): '''push item into hashheap.
:input: item :type: type of item :return: None :type: None '''def pop(self): '''Remove and return the top of the HashHeap.
:input: None :type: None :return: item in hashheap :type: type of item in hashheap '''def top(self): '''Return the top of the HashHeap without remove it.
:input: None :type: None :return: item in hashheap :type: type of item in hashheap '''def remove(self, item): '''remove element in HashHeap in O(logn) time complexity.
:input: param :type: dict :return: None :type: None '''
And ...
Pull requests are encouraged!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file HashHeap-1.0.0.tar.gz
.
File metadata
- Download URL: HashHeap-1.0.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0a1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d915615392364aef6c874c5a66476061ac7c1dd615fe5ee6bcbfd1b60e69b189 |
|
MD5 | e41bdd9e3c507af4b2afbedd5cd85b12 |
|
BLAKE2b-256 | a1d322ff98f5f5ee1b7c22bcb6338be01fc80bb79b3b4e459a6d05fed4d49250 |
File details
Details for the file HashHeap-1.0.0-py2.py3-none-any.whl
.
File metadata
- Download URL: HashHeap-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.7.0a1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2073cdb2355af97863a8ca9eac560200b6e03180817a84df3327eeb419e3c6a3 |
|
MD5 | bc11183ecd8bac18f7b01511cded5079 |
|
BLAKE2b-256 | 8a082e0cebcc31f773df331d3c940d6683d64db3311d7f1d92e1f76f449b697a |