Optimal Partition Search
Overview and Functionality
- Official Implementation of the paper - "Optimal Partition Search"
- Searches for the optimal number of partitions required to speed up the search process
- Works for arrays having any data type (int, float, char, long, etc.)
- Independent of the order of the elements in the array, i.e. can work for both sorted and unsorted array settings
Usage
- Make sure you have Python version 3.9 or greater installed on your system
- Run the following command on the terminal to install this package:
pip install Optimal-Partition-Search
Example
# test.py
from Optimal_Partition_Search import optimal_partition_search
import random
import numpy as np
# Example for array having integer values
array = random.sample(range(150), 100)
print(f'array: {array}')
element = int(input("Enter the item you want to search\n"))
optimal_partition = optimal_partition_search(array, element)
print("Optimal no. of partitions", optimal_partition)
# Example for array having float values
array = np.random.uniform(low=600.5, high=705.2, size=(10,))
print(f'array: {array}')
element = float(np.random.choice(array, 1))
optimal_partition = optimal_partition_search(array, element)
print("Optimal no. of partitions", optimal_partition)
# Example for array having character and string values
array = ['a', 'c', 'q', 'l', 'h', 's', 'tr', 'input']
print(f'array: {array}')
element = input("Enter the item you want to search\n")
optimal_partition = optimal_partition_search(array, element)
print("Optimal no. of partitions", optimal_partition)
Use the following command to run the examples given in the test.py file above:
python test.py
Metadata
Release files for Optimal-Partition-Search 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| Optimal_Partition_Search-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for Optimal_Partition_Search-0.0.1-py3-none-any.whl |
Release files / Optimal_Partition_Search-0.0.1-py3-none-any.whl
| Download URL | Optimal_Partition_Search-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
35bbe380ba8c1ee3efe53345858598a69d35d380879977e4501467a557e163f3
|
|
BLAKE2b-256 checksum How to use checksums |
815dc39b995a414f3610b515a5857df518f95f6a3400c318db15492ce8200767
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.12
|
Security for Optimal-Partition-Search 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.