python icon indicating copy to clipboard operation
python copied to clipboard

Implementation of All ▲lgorithms in Python Programming Language

We are accepting all pull requests. Read More





Algorithms Logo





What is an algorithm?    Contributing    Stickers & T-Shirts

Twitter     Instagram     Github    


Huge collection of All ▲lgorithms implemented in multiple languages


See

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
  • Backtracking
  • Bit Manipulation
  • Cellular Automaton
  • Ciphers
  • Computational Geometry
  • Cryptography
  • Data Structures
  • Divide and conquer
  • Dynamic Programming
  • Gaming Theory
  • Graphs
  • Greedy Algorithms
  • Math
  • Networking
  • Numerical Analysis
  • Operating system
  • Randomized Algorithms
  • Searches
  • Selections Algorithms
  • Sorting
  • Strings
  • Online Challenges
  • Others

Artificial Intelligence

Backtracking

  • Algorithm X
  • Crossword Puzzle
  • Knight Tour
  • M Coloring Problem
  • N Queen
  • Number of ways in Maze
  • Partitions of set
  • Permutation of Strings
  • Powerset
  • Rat in maze
  • Subset Sum
  • Sudoku Solve

Bit Manipulation

  • Addition using bits
  • Bit divisor
  • Byte swapper
  • Convert numbers to binary
  • Count set bits
  • Flip bits
  • Hamming distance
  • Invert bit
  • Lonely integer
  • Magic Number
  • Maximum XOR Value
  • Power of 2
  • Subset Generation
  • Sum binary numbers
  • Sum equals XOR
  • Thrice unique number
  • Twice unique number
  • XOR Swap

Cellular Automaton

  • Brians Brain
  • Conways Game of life
  • Elementary Cellular Automata
  • Generic Algorithm
  • Langtons Ant
  • Nobili Cellular Automata
  • Von Neoumann Cellular Automata

Computational Geometry

  • 2D Line intersection
  • 2D Separating Axis test
  • Area of polygon
  • Area of triangle
  • Axis aligned bounding box collision
  • Bresenham Line
  • Chans Algorithm
  • Cohen Sutherland Lineclip
  • Distance between points
  • Graham Scan
  • Halfplane intersection
  • Jarvis March
  • Quickull
  • Sphere tetrahedron intersection
  • Sutherland Hodgeman clipping

Cryptography

  • Affine Cipher
  • Atbash Cipher
  • Autokey Cipher
  • Baconian Cipher
  • Caesar Cipher
  • Colummnar Cipher
  • Vigenere Cipher

Data Structures

  • Bag
  • Hashes
  • Linked List
  • List
  • Queue
  • Stack
  • Tree

Divide and conquer

  • Strassen Matrix Manipulation
  • Closest Pair of Point
  • Inversion Count
  • Karatsuba Multiplication
  • Maximum Contiguous subsequence sum
  • Merge Sort using divide and conquer
  • Quick Sort using divide and conquer
  • Tournament Method to find min max
  • Warnock Algorithm
  • X Power Y

Dynamic Programming

  • Array Median
  • Optima Binary Search Tree
  • Binomial Coefficient

Gaming Theory

  • Nim Next Best Move Game
  • Nim Win Loss Game
  • Grundy Numbers Kayle Game

Graphs

  • Bipartite Check
  • Adjacency Lists graphs representation
  • A* (A Star)

Greedy Algorithms

  • Activity Selection
  • Dijkstra Shortest Path
  • Egyptian Fraction

Math

  • 2 Sum
  • Add Polynomials
  • Amicable Numbers
  • Armstrong Numbers
  • Automorphic Numbers
  • Average Stream Numbers
  • Babylonian Method
  • Binomial Coefficient
  • Catalan Number
  • Check is Square
  • Convolution
  • Coprime Numbers
  • Count Digits
  • Count Trailing Zeroes
  • Decoding of String
  • Delannoy Number
  • Derangements
  • DFA Division
  • Diophantine
  • Divided Differences
  • Euler Totient
  • Exponentiation Power
  • Factorial
  • Fast Fourier transform
  • Fast inverse (sqrt) Square Root

Networking

  • Packet Sniffer
  • Determine Endianess
  • Validate IP

Numerical Analysis

  • Integral
  • Monte Carlo
  • Runge Kutt

Operating system

  • Currency
  • Deadlocks
  • Memory Management
  • Scheduling
  • Shell

Randomized Algorithms

  • Birthday Paradox
  • Karger Minimum Cut Algorithm
  • Kth Smallest Element Algorithm
  • Random from Stream
  • Random Node Linked list
  • Randomized Quicksort
  • Reservoir Sampling
  • Shuffle an Array

Searches

  • Binary Search
  • Exponential Search
  • Fibonacci Search
  • Fuzzy Search
  • Interpolation Search
  • Jump Search
  • Linear Search
  • Ternay Search

Selections Algorithms

  • Median of Medians
  • Quick Select

Sorting

  • Bead Sort
  • Bogo Sort
  • Bubble Sort
  • Bucket Sort
  • Circle Sort
  • Comb Sort
  • Counting Sort
  • Cycle Sort
  • Flash Sort
  • Gnome Sort
  • Heap Sort
  • Insertion Sort
  • Intro Sort
  • Median Sort
  • Merge Sort
  • Pipeonhole Sort
  • Quick Sort
  • Radix Sort
  • Selection Sort
  • Shaker Sort
  • Shell Sort
  • Sleep Sort
  • Stooge Sort
  • Topological Sort
  • Tree Sort

Strings

  • Aho Corasick Algorithm
  • Anagram Search
  • Arithmetic on large numbers
  • Boyer Moore Algorithm
  • Finite Automata
  • Kasai Algorithm
  • Kmp Algorithm
  • Levenshteing Distance
  • Lipogram Checker

Online Challenges

  • Coderbyte
  • Code Chef
  • Code Eval
  • Hackerearth
  • Hackerrank
  • LeetCode
  • Project Euler
  • Rosalind
  • SPOJ
  • Top Coder`

Others

  • Average
  • Biggest of n numbers
  • Biggest Suffix
  • Fifteen Puzzle
  • Jaccard Similarity
  • Jose Phus Problem
  • Lapindrom Checker
  • Leap Year
  • Magic Square
  • Majority Element
  • Minimum subarray size with degree
  • No operator addition
  • Paint fill
  • Split list
  • Tokenizer
  • Unique number

License

This work is released under MIT License.

To the extent possible under law, Abraham Hernandez (@abranhe) has waived all copyright and related or neighboring rights to this work.