This repository is not maintained

Overview

This repository is no longer maintained, but is being kept around for educational purposes. If you want a more complete algorithms repo check out: https://github.com/keon/algorithms

Algorithms

https://travis-ci.org/nryoung/algorithms.svg?branch=master http://codecov.io/github/nryoung/algorithms/coverage.svg?branch=master https://readthedocs.org/projects/algorithms/badge/?version=latest

Algorithms is a library of algorithms and data structures implemented in Python.

The main purpose of this library is to be an educational tool. You probably shouldn't use these in production, instead, opting for the optimized versions of these algorithms that can be found else where.

You should totally check out the docs for implementation details, complexities and further info.

Usage

If you want to use the algorithms in your code it is as simple as:

from algorithms.sorting import bubble_sort

my_list = bubble_sort.sort(my_list)

Features

  • Pseudo code, algorithm complexities and futher info with each algorithm.
  • Test coverage for each algorithm and data structure.
  • Super sweet documentation.

Installation:

Installation is as easy as:

$ pip install algorithms

Tests:

Pytest is used as the main test runner and all Unit Tests can be run with:

$ ./run_tests.py

Contributing:

Contributions are always welcome. Check out the contributing guidelines to get started.

Comments
  • Missing tests - Adding two missing tests and re-ordering existing tests.

    Missing tests - Adding two missing tests and re-ordering existing tests.

    • I recently started using this library for practicing implementation of some algorithms and I decided to run some tests. I saw the tests were a little bit un-ordered so it was difficult to keep track.
    • The files in directory are arranged in alphabetical order and so if the tests are too arranged in that way, it is better to analyze the code for a third person viewing it.
    • So I have ordered the tests in each file alphabetically, and on the way I discovered that two tests were not written - bogo sort, and primality test. I have added them in too.
    • I develop in Pycharm IDE by Jetbrains community, and nowadays many python users do so. This IDE generates a .idea/ directory which does not need to be on Github, so I also updated the gitignore file in the PR.
    • I do not intend to do more work in the PR unless there are issues with the current code written here. So if the checks pass and the reviewer feels it is proper, this PR is fit to be merged. :+1:
    needs work 
    opened by kdexd 14
  • Add Suffix and LCP arrays algorithms

    Add Suffix and LCP arrays algorithms

    The implementation is correct, but some optimizations should be done (ex: we can replace suffix array by suffix trees to reduce complexity to O(n)), I will do it in next commits.

    needs work 
    opened by proserve 8
  • Breadth First Search (BFS)

    Breadth First Search (BFS)

    Breadth First Search (BFS)

    A Searching Algorithm Based on Graph Traversal

    Breadth First Search Vs. Depth First Search
  • `BFS` uses a **queue** (FIFO) data structure in its implementation.
  • `DFS` uses a **stack** (FILO) data structure in its implementation.
  • 1. I added the **implementation** of the breadth first search algorithm. 2. I added the **proper tests** for the breadth first search algorithm.

    Please let me know if there is anything else that I need to add :smile:.

    opened by CleverProgrammer 7
  • Longest Common Subsequence

    Longest Common Subsequence

    Hi,

    I restyled the document and added some unit tests. Apologies if anything else is wrong, I'm quite new to collaborative projects but I really like algorithms and would like to contribute here!

    opened by Mihai925 6
  • Added Stack Type

    Added Stack Type

    Haven't written any unit test yet, but I can confirm that it works. Code is fairly self explanatory.

    Gets round the lack of pointers by storing the top of the stack as a child of the object (StackData) being pushed onto the stack.

    opened by Sourceless 4
  • Using Size() method to check if stack is empty , removed unnecessary class variable declaration

    Using Size() method to check if stack is empty , removed unnecessary class variable declaration

    • Size() method is already present to calculate length of stack ,reusing this method to check stack empty or not .
    • Removed class variable declaration which isn't required

    @nryoung Please review this PR

    opened by yavinash 3
  • is prime, prime decomposition and totient functions

    is prime, prime decomposition and totient functions

    I made a PR a LOOOONG time ago and completely forgot to add tests, so it was closed - here is that same request with tests! Apologies for taking months...

    opened by johnmarinelli 3
  • Mersenne twister

    Mersenne twister

    I implemented the Mersenne twister algorithm, following the pseudocode on the Wikipedia article closely. I'm not sure how to test something like this, though.

    (Apologies if my style is not good; I haven't been programming for very long.)

    opened by rskwan 3
  • Update queue.py

    Update queue.py

    Removed the first as it became unessary because init itself makes a deque object Made the deque object as private so as to protect from unessary alteration from users

    opened by RitamDey 2
Owner
Nic Young
Nic Young
Repository for data structure and algorithms in Python for coding interviews

Python Data Structures and Algorithms This repository contains questions requiring implementation of data structures and algorithms concepts. It is us

Prabhu Pant 1.9k Jan 1, 2023
This is the code repository for 40 Algorithms Every Programmer Should Know , published by Packt.

40 Algorithms Every Programmer Should Know, published by Packt

Packt 721 Jan 2, 2023
There are some basic arithmatic in Pattern Recognization and Machine Learning writed in Python in this repository

There are some basic arithmatic in Pattern Recognization and Machine Learning writed in Python in this repository

null 1 Nov 19, 2021
This repository is an individual project made at BME with the topic of self-driving car simulator and control algorithm.

BME individual project - NEAT based self-driving car This repository is an individual project made at BME with the topic of self-driving car simulator

NGO ANH TUAN 1 Dec 13, 2021
Repository for Comparison based sorting algorithms in python

Repository for Comparison based sorting algorithms in python. This was implemented for project one submission for ITCS 6114 Data Structures and Algorithms under the guidance of Dr. Dewan at the University of North Carolina at Charlotte, Fall 2021.

Devashri Khagesh Gadgil 1 Dec 20, 2021
This repository is not maintained

This repository is no longer maintained, but is being kept around for educational purposes. If you want a more complete algorithms repo check out: htt

Nic Young 2.8k Dec 30, 2022
🔥 Pyflame: A Ptracing Profiler For Python. This project is deprecated and not maintained.

Pyflame: A Ptracing Profiler For Python (This project is deprecated and not maintained.) Pyflame is a high performance profiling tool that generates f

Uber Archive 3k Jan 7, 2023
Python PDF Parser (Not actively maintained). Check out pdfminer.six.

PDFMiner PDFMiner is a text extraction tool for PDF documents. Warning: As of 2020, PDFMiner is not actively maintained. The code still works, but thi

Yusuke Shinyama 4.9k Jan 4, 2023
Deep Q-Learning Network in pytorch (not actively maintained)

pytoch-dqn This project is pytorch implementation of Human-level control through deep reinforcement learning and I also plan to implement the followin

Hung-Tu Chen 342 Jan 1, 2023
Repository tracking all OpenStack repositories as submodules. Mirror of code maintained at opendev.org.

OpenStack OpenStack is a collection of interoperable components that can be deployed to provide computing, networking and storage resources. Those inf

Mirrors of opendev.org/openstack 4.6k Dec 28, 2022
This is discord nitro code generator and checker made with python. This will generate nitro codes and checks if the code is valid or not. If code is valid then it will print the code leaving 2 lines and if not then it will print '*'.

Discord Nitro Generator And Checker ⚙️ Rᴜɴ Oɴ Rᴇᴘʟɪᴛ ??️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs If you are taking code from this repository without a fork, then atleast

Vɪɴᴀʏᴀᴋ Pᴀɴᴅᴇʏ 37 Jan 7, 2023
No longer maintained, please migrate to model_bakery

Model Mommy: Smart fixtures for better tests IMPORTANT: Model Mommy is no longer maintained and was replaced by Model Bakery. Please, consider migrati

Bernardo Fontes 917 Oct 4, 2022
No longer maintained, please migrate to model_bakery

Model Mommy: Smart fixtures for better tests IMPORTANT: Model Mommy is no longer maintained and was replaced by Model Bakery. Please, consider migrati

Bernardo Fontes 917 Oct 4, 2022
Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs.

Twython Twython is a Python library providing an easy way to access Twitter data. Supports Python 3. It's been battle tested by companies, educational

Ryan McGrath 1.9k Jan 2, 2023
OpenStack Hacking Style Checks. Mirror of code maintained at opendev.org.

Introduction hacking is a set of flake8 plugins that test and enforce the OpenStack StyleGuide Hacking pins its dependencies, as a new release of some

Mirrors of opendev.org/openstack 224 Jan 5, 2023
NO LONGER MAINTAINED - A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.

NO LONGER MAINTAINED This repository is no longer maintained due to lack of time. You might check out the fork https://github.com/mrevutskyi/flask-res

null 1k Jan 4, 2023
NO LONGER MAINTAINED - A Flask extension for creating simple ReSTful JSON APIs from SQLAlchemy models.

NO LONGER MAINTAINED This repository is no longer maintained due to lack of time. You might check out the fork https://github.com/mrevutskyi/flask-res

null 1k Jan 15, 2021
Home Assistant custom integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, officially maintained by the Tuya Developer Team.

Tuya Home Assistant Integration Home Assistant custom integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, officially mainta

Tuya 704 Jan 3, 2023
Powerful Telegram Maintained UserBot in Telethon

Fire-X UserBot The Awaited Bot Fire-X userbot The Most Powerful Telegram Userbot. This Userbot is Safe to use in Your Telegram Account. It is not like

null 22 Oct 21, 2022
Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API

pycord A fork of discord.py. PyCord is a modern, easy to use, feature-rich, and async ready API wrapper for Discord written in Python. Key Features Mo

Pycord Development 2.3k Dec 31, 2022