A collection of common data structures
Project description
snowowl
A collection of common data structures
Example: How to use Heap library
#!/usr/bin/env python3
author: greyshell
from snowowl import Heap, HeapType
if __name__ == '__main__':
arr = [5, 9, 2]
hmin = Heap(arr) # create a min heap
print(hmin.peek()) # peek the min item from the heap
hmin.insert(1) # insert an item into the heap
print(hmin.remove()) # remove an item from the heap
print(hmin) # print all items from the heap
print(len(hmin)) # print the length of the heap
hmax = Heap(arr, HeapType.MAX) # create a max heap
print(hmax.peek()) # peek the max item from the heap
hmax.insert(1) # insert an item into the heap
print(hmax.remove()) # remove an item from the heap
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
snowowl-0.0.3.tar.gz
(15.6 kB
view details)
Built Distribution
snowowl-0.0.3-py3-none-any.whl
(16.8 kB
view details)
File details
Details for the file snowowl-0.0.3.tar.gz
.
File metadata
- Download URL: snowowl-0.0.3.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.9 CPython/3.9.7 Linux/5.10.0-kali9-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4543546e63f39936303af56bd2622fb0a7f9bb5d2f58cf5f99f0bc7b7b86cc80 |
|
MD5 | db629a76b5a97714fa3e4705a840b367 |
|
BLAKE2b-256 | ea4f1ddefcd265f22957a281c635918176a842106a597aff917905bd6aab1fc1 |
File details
Details for the file snowowl-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: snowowl-0.0.3-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.9 CPython/3.9.7 Linux/5.10.0-kali9-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0786c27e6e9ff168ae09425ac23cb1a83884bfdc0a5e4fe4f4f86e05075496d2 |
|
MD5 | 2ed5e4b6e712af719aaaf1854bdc07cb |
|
BLAKE2b-256 | e76a410b8ef6b7fe4e59efc45eedb25c3d5967cb8a4629097c96d18f16e9c874 |