A minimal Python algorithms library with clean implementations of search algorithms and sort algorithms
Project description
algokit-py
A lightweight Python algorithms library with clean, well-documented, and tested implementations. Designed for learning, interviews, and real-world algorithm reasoning.
Features
Search Algorithms
- Linear Search
- Binary Search (iterative, invariant-based)
Sorting Algorithms
- Bubble Sort (in-place, stable, O(n²))
- Insertion Sort (in-place, stable, O(n²))
- Merge Sort (stable, divide-and-conquer, O(n log n), extra space)
- Quick Sort (in-place, average O(n log n), not stable)
Usage
Install
pip install algokit-py
Search
from algokit_py.search import linear_search, binary_search
print(linear_search([1, 2, 3], 2))
print(binary_search([1, 2, 3], 2))
Sorting
from algokit_py.sort import bubble_sort, insertion_sort, merge_sort, quick_sort
# Bubble Sort (in-place)
data = [3, 1, 2]
bubble_sort(data)
print(data) # [1, 2, 3]
# Insertion Sort (in-place)
data = [3, 1, 2]
insertion_sort(data)
print(data) # [1, 2, 3]
# Merge Sort (returns new list)
print(merge_sort([3, 1, 2])) # [1, 2, 3]
# Quick Sort (in-place)
data = [3, 1, 2]
quick_sort(data)
print(data) # [1, 2, 3]
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
algokit_py-0.5.0.tar.gz
(6.0 kB
view details)
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 algokit_py-0.5.0.tar.gz.
File metadata
- Download URL: algokit_py-0.5.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52d12bf87ef94ddf989cef77648198948fdedc3c31a380a01616b7e1cc37b073
|
|
| MD5 |
9ad221b6ebd0b7f498f41c6fb432db70
|
|
| BLAKE2b-256 |
ffd22bc4feb8a774e9885b8ced1387ab176bcf6d3fcc74e47b85fcedcc457437
|
File details
Details for the file algokit_py-0.5.0-py3-none-any.whl.
File metadata
- Download URL: algokit_py-0.5.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3949b259f2f1a15f98df70b7443f6480cbfc2ff89e3e2e632ef1ca2b1eee70bf
|
|
| MD5 |
5cbec377dffdc2fa7d5379d8e9d7de23
|
|
| BLAKE2b-256 |
36964e69148efc27141d4ba43907a20692377eb20fc49a9d237c18802caca921
|