RangedHeap data structure
Project description
RangedHeap
Welcome to the RangedHeap documentation! This documentation provides an overview of the RangedHeap data structure, its methods, and examples of its usage.
For more details, please refer to the documentation.
What is RangedHeap?
RangedHeap is a data structure designed to manage a collection of choices associated with integer values within a specified range [0, k]. It supports efficient operations for adding, deleting, and retrieving choices based on their integer values.
Features
- Efficient Choice Management: Manage choices efficiently within a specified integer range.
- Dynamic Updates: Support dynamic updates to the heap as choices change.
- Optimized Retrieval: Quickly retrieve the best choice based on specified criteria (minimum or maximum).
How to Use
The RangedHeap is particularly useful for implementing algorithms that require optimal selection from a set of integer-ranged choices, such as greedy algorithms.
Example Usage
import ranged_heap as rh
choices = [(1, 4), (2, 3), (3, 5), (0, 6), (5, 7), (8, 9)]
k = max(end for _, end in choices)
ranged_heap = rh.RangedHeap(k, choices)
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 ranged_heap-0.1.0.tar.gz
.
File metadata
- Download URL: ranged_heap-0.1.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Linux/6.5.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fa34b34e3b38f56c3fb4f9ffbc3c98d95095d53e41e1cfc1c1710d9465ac9ad |
|
MD5 | a2dc6ca086a2245f03d1d08bbc82404f |
|
BLAKE2b-256 | 165f0503a5ea8b46eb9fddd59eb5d5a089b0cf87de0dc25272fa9a4b6f987b71 |
File details
Details for the file ranged_heap-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: ranged_heap-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Linux/6.5.0-1023-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ac4dca08ca3e152cc0e6a0d71ca6b36b7f9265e275890995501b6148b174fd5 |
|
MD5 | e63d86eb34c1df81e0a5fa02353599e8 |
|
BLAKE2b-256 | cb91215b00b6c4e5c67726e7854574290ddaebfecccf86c28fd17ba56c19e9f2 |