Search & sort algorithms with performance metrics. Essential for AI and ML applications. Perfect for AI agents and LLM applications.
Project description
pysearchalgo
Search & sort algorithms
Installation
pip install pysearchalgo
💡 Usage Examples
Basic Operations
from pylib_searchalgo import binary_search, linear_search, quick_sort, merge_sort
# Binary search in sorted array
arr = [1, 3, 5, 7, 9]
index = binary_search(arr, 5)
# 2
# Linear search
index = linear_search([1, 2, 3, 4, 5], 3)
# 2
# Quick sort
sorted_arr = quick_sort([3, 1, 4, 1, 5])
# [1, 1, 3, 4, 5]
# Merge sort
sorted_arr = merge_sort([3, 1, 4, 1, 5])
# [1, 1, 3, 4, 5]
AI/ML Use Cases
from pylib_searchalgo import binary_search, linear_search, quick_sort, merge_sort
# Search sorted feature vectors
features = sorted([0.1, 0.5, 0.9, 0.3])
target_index = binary_search(features, 0.5)
# Sort training data
sorted_data = quick_sort(training_data, key=lambda x: x['score'])
📚 API Reference
See package documentation for complete API reference.
🤖 AI Agent Friendly
This package is optimized for AI agents and code generation tools:
- Clear function names and signatures
- Comprehensive docstrings with examples
- Type hints for better IDE support
- Common use cases documented
- Zero dependencies for reliability
License
MIT
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 pylib_searchalgo-0.1.0.tar.gz.
File metadata
- Download URL: pylib_searchalgo-0.1.0.tar.gz
- Upload date:
- Size: 2.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
167fd8765ede8829a2d472bf5ee1b452fd02a6cb9b5a398fc1ae899a8d0691e5
|
|
| MD5 |
ee3b0f48e7d4854d688fb2b09763f014
|
|
| BLAKE2b-256 |
d85b8ced29b97d7b4bb9f6fbbef15c44c0c4471eaebf4ba386f4146419605c9a
|
File details
Details for the file pylib_searchalgo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pylib_searchalgo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1383558c8884d61a6e8573e11847c8a936c8e873bdf06bebda0db96bc96d024
|
|
| MD5 |
49516b6a471ea4d476015b83b393f9f2
|
|
| BLAKE2b-256 |
f1b9ab3586abbba044d22c05a105f7baca23e40bb9dd061a2dcab8d94229aff8
|