interval-search provides predicate-based binary and doubling search implementations
Project description
interval-search
interval-search provides predicate-based binary and doubling search implementations
Free software: MIT license
Documentation: https://interval-search.readthedocs.io.
import interval_search as inch
# inch.binary_search
list_ = [1, 10, 20, 500, 5000]
binary_search(lambda x: list_[x] >= 20, 0, len(list_) - 1)
# -> 2
# inch.doubling_search
inch.doubling_search(lambda x: x >= 5) # -> 5
# with a lower bound to start searching at,
inch.doubling_search(lambda x: x >= 5, 10) # -> 10
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.0.0 (2022-02-22)
First release on PyPI.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file interval-search-0.1.2.tar.gz.
File metadata
- Download URL: interval-search-0.1.2.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b784da42df24d68e0adc3a0634104dec34a89e411077d2e9246a4be6554caab
|
|
| MD5 |
f051e58132907527ddf2919d4967e8c2
|
|
| BLAKE2b-256 |
d022e101f011537a28e38a4dc4d8490d7a8fe7861a9c12e45c34ecdd545fa28d
|
File details
Details for the file interval_search-0.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: interval_search-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9632f31016c4b64669352099a99b244e7423c544cc353318ea96ffb6212667c2
|
|
| MD5 |
cd985ac02d3aaf90c8dabf185f0bb699
|
|
| BLAKE2b-256 |
b0acc6232c25eedbfe3fa4ef79022ddcbccd7de931b0fd1767cac99dee715c61
|