Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pylib_searchalgo-0.1.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pylib_searchalgo-0.1.0-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

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

Hashes for pylib_searchalgo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 167fd8765ede8829a2d472bf5ee1b452fd02a6cb9b5a398fc1ae899a8d0691e5
MD5 ee3b0f48e7d4854d688fb2b09763f014
BLAKE2b-256 d85b8ced29b97d7b4bb9f6fbbef15c44c0c4471eaebf4ba386f4146419605c9a

See more details on using hashes here.

File details

Details for the file pylib_searchalgo-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pylib_searchalgo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c1383558c8884d61a6e8573e11847c8a936c8e873bdf06bebda0db96bc96d024
MD5 49516b6a471ea4d476015b83b393f9f2
BLAKE2b-256 f1b9ab3586abbba044d22c05a105f7baca23e40bb9dd061a2dcab8d94229aff8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page