https://github.com/sanoguzhan/stalib
Standard Template and algorithms library of C++ for Python with C-Python API
https://github.com/sanoguzhan/stalib
algorithms-library cpp11 cpython-api cython-wrapper python
Last synced: about 1 year ago
JSON representation
Standard Template and algorithms library of C++ for Python with C-Python API
- Host: GitHub
- URL: https://github.com/sanoguzhan/stalib
- Owner: sanoguzhan
- License: mit
- Created: 2020-10-05T21:46:31.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-15T11:41:17.000Z (over 5 years ago)
- Last Synced: 2025-04-25T15:18:31.413Z (about 1 year ago)
- Topics: algorithms-library, cpp11, cpython-api, cython-wrapper, python
- Language: Python
- Homepage:
- Size: 180 KB
- Stars: 1
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# STALib

[](https://pepy.tech/project/stalib)

[](http://github.com/badges/stability-badges)
Standard Template and algorithms library of C++ for Python with C-Python API
Stalib Library includes complementary algotrithms and templates to Python's ``built-in``.
The algorithms implemented in C++ and extended to Python and compitable with Python's ``list`` objects.
Algorithms:
| Name | Type | Worst-case Performance | Module
| ------------- |:-------------:| --------------------------------:|-------------:|
| [Buble Sort](https://en.wikipedia.org/wiki/Bubble_sort) | Sort | O(n^2)|algorithms
| [Merge Sort](https://en.wikipedia.org/wiki/Merge_sort) | Sort | O(nlogn) |algorithms
| [Quick Sort](https://en.wikipedia.org/wiki/Quicksort)| Sort | O(n^2) |algorithms
| [Binary Search](https://en.wikipedia.org/wiki/Binary_search_algorithm)| Search | *O(Logn) |algorithms
*Sorted Array
------
## Getting started
To get started, install the library with [pip](https://pip.pypa.io/en/stable/)
```bash
pip install stalib
```
## Example
Import the algorithms or templates:
```python
>>> from stalib.algorithms import merge_sort
>>> iterable = [1,9,2,4]
>>> list(merge_sort(iterable))
[1, 2, 4, 9]
```
For the full listing of functions, see [stalib](https://pypi.org/project/stalib/)