Files
templates
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
We are accepting all pull requests. [Read More](#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">What is an algorithm?</a> <a href="https://github.com/AllAlgorithms/algorithms/blob/master/.github/contributing.md">Contributing</a> <a href="https://www.redbubble.com/people/abranhe/works/34285088">Stickers & T-Shirts</a> </p> <p> <a href="https://twitter.com/AllAlgorithms"> <img src="https://cdn.svgporn.com/logos/twitter.svg" width="17px"> Twitter </a> <a href="https://instagram.com/AllAlgorithms"> <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"> <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"><img src="https://cdn.abranhe.com/projects/algorithms/badge.svg" /></a> <a href="https://cash.me/$abranhe"><img src="https://cdn.abranhe.com/badges/cash-me.svg"></a> <a href="https://paypal.me/abranhe/10"><img src="https://cdn.abranhe.com/badges/paypal.svg"></a> <a href="https://patreon.com/abranhe"><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/generic-algorithm) - [Langtons Ant](cellular-automaton/langtons-ant) - [Nobili Cellular Automata](cellular-automaton/nobili-cellular-automata) - [Von Neoumann Cellular Automata](cellular-automaton/von-neoumann-cellular-automata) ## [Computational Geometry](computational-geometry) - [2D Line intersection](computational-geometry/) - [2D Separating Axis test](computational-geometry/) - [Area of polygon](computational-geometry/) - [Area of triangle](computational-geometry/) - [Axis aligned bounding box collision](computational-geometry/) - [Bresenham Line](computational-geometry/) - [Chans Algorithm](computational-geometry/) - [Cohen-Sutherland Lineclip](computational-geometry/) - [Distance between points](computational-geometry/) - [Graham Scan](computational-geometry/) - [Halfplane intersection](computational-geometry/) - [Jarvis March](computational-geometry/) - [Quickhull](computational-geometry/) - [Sphere tetrahedron intersection](computational-geometry/) - [Sutherland-Hodgman clipping](computational-geometry/) ## [Cryptography](cryptography) - [Affine Cipher](cryptography/) - [Atbash Cipher](cryptography/) - [Autokey Cipher](cryptography/) - [Baconian Cipher](cryptography/) - [Caesar Cipher](cryptography/) - [Colummnar Cipher](cryptography/) - [Vigenere Cipher](cryptography/) ## [Data Structures](data-structures) - [Bag](data-structures/bag/) - [Hashes](data-structures/hashes/) - [Linked List](data-structures/linked-list/) - [List](data-structures/list/) - [Queue](data-structures/queue/) - [Stack](data-structures/stack/) - [Tree](data-structures/tree/) ## [Divide and conquer](divide-and-conquer) - [Strassen Matrix Manipulation](divide-and-conquer/) - [Closest Pair of Point](divide-and-conquer/) - [Inversion Count](divide-and-conquer/) - [Karatsuba Multiplication](divide-and-conquer/) - [Maximum Contiguous subsequence sum](divide-and-conquer/) - [Merge Sort using divide and conquer](divide-and-conquer/) - [Quick Sort using divide and conquer](divide-and-conquer/) - [Tournament Method to find min max](divide-and-conquer/) - [Warnock Algorithm](divide-and-conquer/) - [X Power Y](divide-and-conquer/) ## [Dynamic Programming](dynamic-programming) - [Array Median](dynamic-programming) - [Optima Binary Search Tree](dynamic-programming) - [Binomial Coefficient](dynamic-programming) ## [Gaming Theory](gaming-theory) - [Nim Next Best Move Game](gaming-theory/) - [Nim Win Loss Game](gaming-theory/) - [Grundy Numbers Kayle Game](gaming-theory/) ## [Graphs](graphs) - [Bipartite Check](graphs/) - [Adjacency Lists graphs representation](graphs/) - [A* (A Star)](https://allalgorithms.com/docs/a-star) ## [Greedy Algorithms](greedy-algorithms) - [Activity Selection](greedy-algorithms) - [Dijkstra Shortest Path](greedy-algorithms) - [Egyptian Fraction](greedy-algorithms) ## [Math](math) - [2 Sum](math/) - [Add Polynomials](math/) - [Amicable Numbers](math/) - [Armstrong Numbers](math/) - [Automorphic Numbers](math/) - [Average Stream Numbers](math/) - [Babylonian Method](math/) - [Binomial Coefficient](math/) - [Catalan Number](math/) - [Check is Square](math/) - [Convolution](math/) - [Coprime Numbers](math/) - [Count Digits](math/) - [Count Trailing Zeroes](math/) - [Decoding of String](math/) - [Delannoy Number](math/) - [Derangements](math/) - [DFA Division](math/) - [Diophantine](math/) - [Divided Differences](math/) - [Euler Totient](math/) - [Exponentiation Power](math/) - [Factorial](math/factorial) - [Fast Fourier Transform](math/) - [Fast inverse (sqrt) Square Root](math/) ## [Networking](networking) - [Packet Sniffer](networking/) - [Determine Endianess](networking/) - [Validate IP](networking/) ## [Numerical Analysis](numerical-analysis) - [Integral](numerical-analysis/integral) - [Monte Carlo](numerical-analysis/monte-carlo) - [Runge Kutt](numerical-analysis/runge-kutt) ## [Operating system](operating-system) - [Currency](operating-system/) - [Deadlocks](operating-system/) - [Memory Management](operating-system/) - [Scheduling](operating-system/) - [Shell](operating-system/) ## [Randomized Algorithms](randomized-algorithms) - [Birthday Paradox](randomized-algorithms) - [Karger Minimum Cut Algorithm](randomized-algorithms) - [Kth Smallest Element Algorithm](randomized-algorithms) - [Random from Stream](randomized-algorithms) - [Random Node Linked list](randomized-algorithms) - [Randomized Quicksort](randomized-algorithms) - [Reservoir Sampling](randomized-algorithms) - [Shuffle an Array](randomized-algorithms) ## [Searches](searches) - [Binary Search](searches) - [Exponential Search](searches) - [Fibonacci Search](searches) - [Fuzzy Search](searches) - [Interpolation Search](searches) - [Jump Search](searches) - [Linear Search](searches) - [Ternay Search](searches) ## [Selections Algorithms](selections-algorithms) - [Median of Medians](selections-algorithms) - [Quick Select](selections-algorithms) ## [Sorting](sorting) - [Bead Sort](sorting/) - [Bogo Sort](sorting/) - [Bubble Sort](sorting/) - [Bucket Sort](sorting/) - [Circle Sort](sorting/) - [Comb Sort](sorting/) - [Counting Sort](sorting/) - [Cycle Sort](sorting/) - [Flash Sort](sorting/) - [Gnome Sort](sorting/) - [Heap Sort](sorting/) - [Insertion Sort](sorting/) - [Intro Sort](sorting/) - [Median Sort](sorting/) - [Merge Sort](sorting/) - [Pigeonhole Sort](sorting/) - [Quick Sort](sorting/) - [Radix Sort](sorting/) - [Selection Sort](sorting/) - [Shaker Sort](sorting/) - [Shell Sort](sorting/) - [Sleep Sort](sorting/) - [Stooge Sort](sorting/) - [Topological Sort](sorting/) - [Tree Sort](sorting/) ## [Strings](strings) - [Aho-Corasick Algorithm](strings) - [Anagram Search](strings) - [Arithmetic on large numbers](strings) - [Boyer-Moore Algorithm](strings) - [Finite Automata](strings) - [Kasai Algorithm](strings) - [Kmp Algorithm](strings) - [Levenshtein Distance](strings) - [Lipogram Checker](strings) ## [Online Challenges](online-challenges) - [Coderbyte](online-challenges/coderbyte) - [Code Chef](online-challenges/code-chef) - [Code Eval](online-challenges/code-eval) - [Hackerearth](online-challenges/hackerearth) - [Hackerrank](online-challenges/hackerrank) - [LeetCode](online-challenges/leetcode) - [Project Euler](online-challenges/project-euler) - [Rosalind](online-challenges/rosalind) - [SPOJ](online-challenges/spoj) - [Top Coder](online-challenges/top-coder)` ## [Others](others) - [Average](others/) - [Biggest of n numbers](others/) - [Biggest Suffix](others/) - [Fifteen Puzzle](others/) - [Jaccard Similarity](others/) - [Jose Phus Problem](others/) - [Lapindrom Checker](others/) - [Leap Year](others/) - [Magic Square](others/) - [Majority Element](others/) - [Minimum subarray size with degree](others/) - [No operator addition](others/) - [Paint fill](others/) - [Split list](others/) - [Tokenizer](others/) - [Unique number](others/) ## License This work is released under MIT License. To the extent possible under law, [Abraham Hernandez (@abranhe)](https://go.abranhe.com/github) has waived all copyright and related or neighboring rights to this work. <div align="center"> <a href="https://github.com/abranhe/algorithms"> <img src="https://cdn.abranhe.com/projects/algorithms/logo.svg" width="50px"> </a> <br> </div>