We are accepting all pull requests. [Read More](https://github.com/AllAlgorithms/algorithms/issues/40)
<div align="center" id="top">
<br>
<br>
<br>
<br>
<img width="500" height="350" src="https://cdn.abranhe.com/projects/algorithms/logo.svg" alt="Algorithms Logo">
<br>
<br>
<br>
<br>
<br>
<br>
<p>
<a href="#what-is-an-algorithm" rel='nofollow' onclick='return false;'>What is an algorithm?</a>
<a href="https://github.com/AllAlgorithms/algorithms/blob/master/.github/contributing.md" rel='nofollow' onclick='return false;'>Contributing</a>
<a href="https://www.redbubble.com/people/abranhe/works/34285088" rel='nofollow' onclick='return false;'>Stickers & T-Shirts</a>
</p>
<p>
<a href="https://twitter.com/AllAlgorithms" rel='nofollow' onclick='return false;'>
<img src="https://cdn.svgporn.com/logos/twitter.svg" width="17px"> Twitter
</a>
<a href="https://instagram.com/AllAlgorithms" rel='nofollow' onclick='return false;'>
<img src="https://www.instagram.com/static/images/ico/apple-touch-icon-152x152-precomposed.png/419a6f9c7454.png" width="17px"> Instagram
</a>
<a href="https://github.com/AllAlgorithms" rel='nofollow' onclick='return false;'>
<img src="https://img.icons8.com/ios-glyphs/90/333333/github.png" width="18px"> Github
</a>
</p>
<br>
<p align="center">
<i>Huge collection of All ▲lgorithms implemented in multiple languages</i>
</p>
<br>
<a href="https://github.com/AllAlgorithms" rel='nofollow' onclick='return false;'><img src="https://cdn.abranhe.com/projects/algorithms/badge.svg" /></a>
<a href="https://cash.me/$abranhe" rel='nofollow' onclick='return false;'><img src="https://cdn.abranhe.com/badges/cash-me.svg"></a>
<a href="https://paypal.me/abranhe/10" rel='nofollow' onclick='return false;'><img src="https://cdn.abranhe.com/badges/paypal.svg"></a>
<a href="https://patreon.com/abranhe" rel='nofollow' onclick='return false;'><img src="https://cdn.abranhe.com/badges/patreon.svg" /></a>
</div>
## See
- [What is an algorithm](#what-is-an-algorithm)
- [Contributing](https://github.com/AllAlgorithms/algorithms/blob/master/.github/contributing.md)
- [Code of Conduct](https://github.com/AllAlgorithms/algorithms/blob/master/.github/code-of-conduct.md)
- [Stickers and T-Shirts](https://www.redbubble.com/people/abranhe/works/34285088)
- [Twitter](https://twitter.com/AllAlgorithms)
- [Instagram](https://instagram.com/AllAlgorithms)
- [Algorithms Categories](#categories)
- [Maintainers](#maintainers)
- [License](#license)
## What is an algorithm?
Informally, an algorithm is any well-defined computational procedure that takes
some value, or set of values, as input and produces some value, or set of values, as
output. An algorithm is thus a sequence of computational steps that transform the
input into the output.
An algorithm should have three important characteristics to be considered valid:
- **It should be finite**: If your algorithm never ends trying to solve the problem
it was designed to solve then it is useless
- **It should have well defined instructions**: Each step of the algorithm has to
be precisely defined; the instructions should be unambiguously specified for each case.
- **It should be effective**: The algorithm should solve the problem it was designed
to solve. And it should be possible to demonstrate that the algorithm converges with
just a paper and pencil.
## Categories
> Structure of The All ▲lgoritms project
- [Artificial Intelligence](#artificial-intelligence)
- [Backtracking](#backtracking)
- [Bit Manipulation](#bit-manipulation)
- [Cellular Automaton](#cellular-automaton)
- [Ciphers](#ciphers)
- [Computational Geometry](#computational-geometry)
- [Cryptography](#cryptography)
- [Data Structures](#data-structures)
- [Divide and conquer](#divide-and-conquer)
- [Dynamic Programming](#dynamic-programming)
- [Gaming Theory](#gaming-theory)
- [Graphs](#graphs)
- [Greedy Algorithms](#greedy-algorithms)
- [Math](#math)
- [Networking](#networking)
- [Numerical Analysis](#numerical-analysis)
- [Operating system](#operating-system)
- [Randomized Algorithms](#randomized-algorithms)
- [Searches](#searches)
- [Selections Algorithms](#selections-algorithms)
- [Sorting](#sorting)
- [Strings](#strings)
- [Online Challenges](#online-challenges)
- [Others](#others)
## [Artificial Intelligence](artificial-intelligence)
- [Density-based spatial clustering of applications with noise (DBSCAN Clustering)](https://allalgorithms.com/docs/dbscan)
- [Interactive Self-Organizing Data Analysis Technique yAy! (ISODATA Clustering)](https://allalgorithms.com/docs/isodata)
- [Linear Regression](https://allalgorithms.com/docs/linear-regression)
- [Logistic Regression](https://allalgorithms.com/docs/logistic-regression)
- [Neutral Style Transfer](https://allalgorithms.com/docs/neutral-style-transfer)
- [SATisfiable (SAT)](https://allalgorithms.com/docs/sat)
- [Travelling salesman problem (TSP)](https://allalgorithms.com/docs/tsp)
- [A* (A Star)](https://allalgorithms.com/docs/a-star)
- [Artificial Neutral Network](https://allalgorithms.com/docs/artificial-neutral-network)
- [Convolutional Neutral Network](https://allalgorithms.com/docs/convolutional-neutral-network)
- [Decision Tree](https://allalgorithms.com/docs/decision-tree)
- [Factorization Machines](https://allalgorithms.com/docs/factorization-machines)
- [Gaussian Mixture Model](https://allalgorithms.com/docs/gaussian-mixtrue-model)
- [Gradient Boosting Trees](https://allalgorithms.com/docs/gradient-boostring-trees)
- [Hierachical Clustering](https://allalgorithms.com/docs/hierachical-clustering)
- [Image Processing](https://allalgorithms.com/docs/image-processing)
- [K Nearest Neighbors](https://allalgorithms.com/docs/k-nearest-neighbors)
- [K Means](https://allalgorithms.com/docs/k-means)
- [Minimax](https://allalgorithms.com/docs/minimax)
- [Native Bayes](https://allalgorithms.com/docs/native-bayes)
- [Nearest Sequence Memory](https://allalgorithms.com/docs/nearest-sequence-memory)
- [Neutral Network](https://allalgorithms.com/docs/neutral-network)
- [Perceptron](https://allalgorithms.com/docs/perceptron)
- [Principal Component Analysis](https://allalgorithms.com/docs/principal-component-analysis)
- [Q Learing](https://allalgorithms.com/docs/q-learning)
- [Random Forests](https://allalgorithms.com/docs/random-forest)
- [Restricted Boltzman Machine](https://allalgorithms.com/docs/restricted-boltzman-machine)
## [Backtracking](backtracking)
- [Algorithm X](backtracking/algorithm-x)
- [Crossword Puzzle](backtracking/crossword-Puzzle)
- [Knight Tour](backtracking/knight-tour)
- [M Coloring Problem](backtracking/m-coloring-problem)
- [N Queen](backtracking/n-queen)
- [Number of ways in Maze](backtracking/number-of-ways-in-maze)
- [Partitions of set](backtracking/partitions-of-set)
- [Permutation of Strings](backtracking/permutation-of-strings)
- [Powerset](backtracking/powerset)
- [Rat in maze](backtracking/rat-in-maze)
- [Subset Sum](backtracking/subset-sum)
- [Sudoku Solve](backtracking/sudoku-solve)
## [Bit Manipulation](bit-manipulation)
- [Addition using bits](bit-manipulation/adding-using-bits)
- [Bit divisor](bit-manipulation/bit-divisor)
- [Byte swapper](bit-manipulation/byte-swapper)
- [Convert numbers to binary](bit-manipulation/convert-numbers-to-binary)
- [Count set bits](bit-manipulation/count-set-bits)
- [Flip bits](bit-manipulation/flip-bits)
- [Hamming distance](bit-manipulation/hamming-distace)
- [Invert bit](bit-manipulation/invert-bit)
- [Lonely integer](bit-manipulation/lonely-integer)
- [Magic Number](bit-manipulation/magic-number)
- [Maximum XOR Value](bit-manipulation/maximun-xor-value)
- [Power of 2](bit-manipulation/power-of-2)
- [Subset Generation](bit-manipulation/subset-generation)
- [Sum binary numbers](bit-manipulation/sum-binary-numbers)
- [Sum equals XOR](bit-manipulation/sum-equals-xor)
- [Thrice unique number](bit-manipulation/thrice-unique-number)
- [Twice unique number](bit-manipulation/twice-unique-number)
- [XOR Swap](bit-manipulation/xor-swap)
## [Cellular Automaton](cellular-automaton)
- [Brians Brain](cellular-automaton/brians-brain)
- [Conways Game of life](cellular-automaton/conways-game-of-life)
- [Elementary Cellular Automata](cellular-automaton/elementary-cellular-automata)
- [Generic Algorithm](cellular-automaton