Skip to main content

Lightweight DSA utilities for Python

Project description

AlgoNest

algonest is a clean, reusable Python DSA utility package focused on production-ready implementations of core algorithmic patterns.

Installation

pip install algonest

Included Modules

  • algonest.search.binary_search: lower_bound, upper_bound, binary_search
  • algonest.arrays.sliding_window: max_sum_subarray_k, longest_unique_substring
  • algonest.sort.sorting: classical sorting algorithms
  • algonest.linked_list: linked list data structures
  • algonest.stack_queue: stack, queue, deque, monotonic stack utilities
  • algonest.heap: min heap, max heap, priority queue
  • algonest.trees: binary trees, BST/AVL, traversals, segment/fenwick trees
  • algonest.graphs: traversal, shortest path, MST, DSU, topological sorting
  • algonest.dynamic_programming: knapsack, LCS/LIS, coin change, MCM, edit distance
  • algonest.strings: KMP, Rabin-Karp, Z algorithm, trie, anagram utilities
  • algonest.math: gcd/lcm, prime utilities, modular arithmetic, bit tricks
  • algonest.utils: validators and shared type helper aliases

Quick Start

from algonest import (
	binary_search,
	longest_unique_substring,
	lower_bound,
	max_sum_subarray_k,
	upper_bound,
)

idx = lower_bound([1, 2, 2, 4], 2)
hi = upper_bound([1, 2, 2, 4], 2)
pos = binary_search([1, 3, 5, 7], 5)
best = max_sum_subarray_k([2, 1, 5, 1, 3, 2], 3)
size = longest_unique_substring("abcabcbb")

Testing

python -m pytest -q tests

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

algonest-0.1.0.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

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

algonest-0.1.0-py3-none-any.whl (49.9 kB view details)

Uploaded Python 3

File details

Details for the file algonest-0.1.0.tar.gz.

File metadata

  • Download URL: algonest-0.1.0.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for algonest-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b36ff19795133ccfbe23a2625b44ccc9e10c1ccc780c9826a95d57d7f85ee2bb
MD5 31c7bb67cc3b1d84187307a656d9a944
BLAKE2b-256 07fba087686b293798d4a77e679f2e59ee25d5296bcd93f0854834b5fac5c398

See more details on using hashes here.

File details

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

File metadata

  • Download URL: algonest-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 49.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for algonest-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dd9bc541d55d2ecae943342b3f821a5286ff7278a090d2bf3e3fea6ede303ccd
MD5 8b18c7e6ad4774a1a0698e343619d847
BLAKE2b-256 7d627b83f3b5a3764c951f29ac4dd3aeb637a884df5899eb28067a44d2656674

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