Skip to content
Share, discuss and learn about algorithm implementations!
Branch: master
Clone or download
Latest commit 937942a Dec 22, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
10_Harshad_Number Harshad number solution in Racket Jun 3, 2018
A_Star_Search used to fix tags Jun 8, 2014
Ackermann Ackermann function in Racket Jun 3, 2018
Alpha_Beta_Pruning used to fix tags Jun 8, 2014
Bellman_Ford_Search Added C++ implementation for bellman ford algorithm Mar 28, 2017
Binary_Search Add test file Aug 9, 2015
Bloom_Filter/Python/argvk bloomfilter py: remove unused variable Feb 21, 2015
Bogobogosort Implemented Bogobogosort in PHP Oct 29, 2015
Boyer_Moore_Horspool Issue 523, Boyer Moore Horspool String Search walked off end the arra… Feb 11, 2018
Bozosort Merge pull request #403 from aayushKumarJarvis/master Aug 13, 2014
Breadth_First_Search i hope this works :-) Oct 8, 2014
Brent_Cycle_Detection_Algorithm Added missing tag files May 20, 2014
Bresenham_Based_Supercover_Line Update bresenham_based_supercover.lua Aug 11, 2018
Bresenham_Line used to fix tags Jun 8, 2014
Bubble_Sort Merge pull request #468 from warreee/master Aug 9, 2015
Burrows_Wheeler_Transform used to fix tags Jun 8, 2014
Caesar_Cipher Added BogoSort C++ Implementation (#510) Mar 27, 2017
Catalan_Numbers Added summation way of getting catalan numbers in scala Jun 15, 2014
Cocktail_Sort Added BogoSort C++ Implementation (#510) Mar 27, 2017
Comb_Sort Added missing tag files, made script executable Jun 8, 2014
Convex_hull Implemented Convex Hull in Python Jul 5, 2016
Counterfeit_Coin_Problem README modification Dec 29, 2014
Counting_Sort Implemented Counting Sort in C#, tried to optimize the default implem… Sep 3, 2014
Decimal_To_Fraction Update dec2frac.lua Dec 22, 2018
Depth_First_Search Add depth first search in C++ Mar 24, 2017
Depth_Limited_Search used to fix tags Jun 8, 2014
Egyptian_Fractions Added egyptian fractions in scala Jun 15, 2014
Einstein_Puzzle Added Einstein Problem in Haskell Jan 10, 2015
Euclidean_Norm Merge pull request #393 from aayushKumarJarvis/master Aug 7, 2014
Euclidean_algorithm Adden the solution and solution test to euclidean algorithm in C#. Jun 27, 2015
Euclidean_distance Merge pull request #395 from aayushKumarJarvis/master Aug 8, 2014
Expression_Evaluation/Java Added Dijkstra's 2-Stack algo for expression eval Jul 17, 2016
Factorial Added BogoSort C++ Implementation (#510) Mar 27, 2017
Fibonacci_series Added C++ fibonacci implementation Feb 19, 2015
FizzBuzz Added BogoSort C++ Implementation (#510) Mar 27, 2017
Floyd_Cycle_Detection_Algorithm Added missing tag files May 20, 2014
Floyd_Warshall Added floyd_warshall Ruby Apr 6, 2015
Gale_Shapely Updated tests Jan 27, 2014
Gauss_Seidel_Algorithm used to fix tags Jun 8, 2014
Golden_Ratio_Algorithms used to fix tags Jun 8, 2014
Hamming_Code Added BogoSort C++ Implementation (#510) Mar 27, 2017
Hamming_Weight Added Hamming Weight in Lua Jan 7, 2014
Happy_Number Ackermann and happy numbers added in C++. Oct 27, 2015
Hash_Table/C++/mike168m Added BogoSort C++ Implementation (#510) Mar 27, 2017
Heap_Sort Changed to full adjectives Oct 14, 2015
HuffmanCoding Added tag files for currently existing algorithm Jan 4, 2014
Interesection_of_Points Adding Problem statement for checking intersection of two points Aug 18, 2014
Iterative_Deepening_Depth_First_Search used to fix tags Jun 8, 2014
Johnson_Search Added Johnson's algorithm. Jun 17, 2014
Josephus_Problem Added iterative solution of josephus problem in ruby Apr 7, 2015
KMeans_Clustering used to fix tags Jun 8, 2014
Knapsack used to fix tags Jun 8, 2014
Lamport_Logical_Clock_synchronization/Go/sjs7007 Added BogoSort C++ Implementation (#510) Mar 27, 2017
Lempel_Ziv_Welch fix LZW decode error Jun 26, 2014
Levenshtein_distance Added Test Classes Aug 15, 2015
Longest_Palindrome/Objective-C Add longest palindrome Aug 9, 2015
Mandelbrot_Set Updates May 27, 2014
Markov-Chain used to fix tags Jun 8, 2014
Maximum_Subarray Maximum Subarray Swift Apr 1, 2018
Merge_Sort Merge pull request #461 from TarangKhanna/master Aug 27, 2015
Minimax used to fix tags Jun 8, 2014
Monty_Hall_Problem added ruby implementation Raul Jordan of monty hall Jan 7, 2015
Move_To_Front_Transform used to fix tags Jun 8, 2014
N_Queens_Problem Added BogoSort C++ Implementation (#510) Mar 27, 2017
Newton_Raphson used to fix tags Jun 8, 2014
Palindrome Test cases for palindrome Mar 3, 2018
Partial_Selection_Sort Added missing tag files May 20, 2014
Playfair_Cipher/Go/sjs7007 Added BogoSort C++ Implementation (#510) Mar 27, 2017
Polynomial_Operations/Java/aayushKumarJarvis Adding new problem statement of Polynomial based functions Aug 13, 2014
Prim_Minimum_Spanning_Tree Add test file from prim mst algorithm Aug 8, 2015
Quick_Sort Quick Sort in Swift Mar 31, 2018
ROT13_Cipher Implement ROT13_Cipher in Fennel Mar 30, 2018
ROT47_Cipher Added missing tag files, made script executable Jun 8, 2014
Rabin_Karp used to fix tags Jun 8, 2014
Radix_Sort used to fix tags Jun 8, 2014
Ranrot-B-Pseudo_Random_Number_Generator Fixed Go names, so that funcs are actually exported. Jun 18, 2014
Roman_Numerals Added C# implementation of Roman Numerals Jan 7, 2015
Russian_Peasant Add javascript implementation for rp Aug 14, 2017
Self_Descriptive_Number Added Self-Descriptive-Number in Python Jun 29, 2014
Shell_Sort Merge pull request #387 from aayushKumarJarvis/master Jul 25, 2014
Sieve_of_Eratosthenes Heapsort and Sieve of Eratosthenes in Scala Oct 13, 2015
Stat_Mode used to fix tags Jun 8, 2014
Stooge_Sort Stooge Sort Java Implementation Aug 20, 2015
Stop_Words Fix dir structure for Stop Words Aug 22, 2016
String_to_int string-to-int funtionality in c++ Oct 21, 2015
Sudoku Add documentation for solution Mar 5, 2015
Symmetric_Difference Added missing tag files, made script executable Jun 8, 2014
The_Twelve_Days_Of_Xmas Added BogoSort C++ Implementation (#510) Mar 27, 2017
Thompsons_Construction_Algorithm used to fix tags Jun 8, 2014
Token_Bucket Added tag files for currently existing algorithm Jan 4, 2014
Tokenization Added missing tag files, made script executable Jun 8, 2014
Towers_Of_Hanoi Added Towers of Hanoi in C Dec 31, 2014
Tries Added own Trie Nov 20, 2014
Union_Find_Algorithm Added BogoSort C++ Implementation (#510) Mar 27, 2017
Vigenere_Cipher Vignere Cipher Java Aug 19, 2015
Warshall used to fix tags Jun 8, 2014
LICENSE Added license. Fixed #164 Jan 7, 2014 Update README title Dec 30, 2017 Added missing tag files, made script executable Jun 8, 2014 added note to fix_tag_files script Jun 8, 2014

Algorithm Implementations

Join the chat at

(Note: there is a backstory on my motivation for starting this at the bottom of this README)


Update 7/19/15 Please include tests with your implementation submissions! Please see Issue #459 on instructions. Thanks for understanding!! <3

Update 1/4/15 Our site is now getting hundreds of unique visitors and thousands of pageviews per day :)

Update 06/09/14 I have released a native Android app for viewing the algorithms! It's a wrapper around the web app with some native functionality. Check it out on Google Play here Algorithm Implementations Android App

Update 05/09/14: I am working on a web application that will tie things up in a much more fluid way, and help exhibit the algorithms to those who either don't know much about git/github, or just can't be vexed clicking through all the folders. This will open the repo up to a much wider audience in general!

You can see a preview here! Algorithms Implementations Website

Please offer up your suggestions in the Issues section of the Github repository

Update 12/30/13: I have given the 3 top committers (jcla1, PatrickYevsukov, dalleng) collaborator access. This was very well earned, as they have managed to contribute much more to this repo than I have had the time to.

Again, thanks so much for the consistency guys, it is extremely appreciated. It made sense to start with giving these guys collab access for obvious reasons, but I also thank every single person who has even submitted a pull request. Without you all, this repository would be nothing.


We see tons of interesting projects that are actively contributed to here on Github. Seriously, it's very powerful.

Unfortunately, I haven't really spotted (a popular and language agnostic) one where people used the power of Git to share, discover, discuss and improve algorithm implementations!

Send us a pull request, and we will add any implementation of any algorithm you have so long as it at least mostly suits the following conventions.


  • Language doesn't matter. Just make sure you're implementing an algorithm.

  • Submissions should follow this directory structure

  • Please include a description of the algorithm you are implementing; it doesn't really matter if it's copied from Wikipedia or not (citations please), but this really does help people who are trying to find new algorithms to implement and contribute by browsing this repository.

  • When implementing a new algorithm, create a "tags" file in the algorithm's root directory and add some appropriate tags

  • Please package your code in a directory bearing your GitHub username. git blame is cool, and has many more appropriate applications, but in this context I'd rather pull a flat list of files and be able to check out everyone's contributions that way than have to look through the revisions.

  • Each algorithm should have its corresponding unit test cases (as directory structure suggested above) which covers the corner cases, happy/unhappy paths. Please see Issue #459 for further discussion on this topic.

    The advantage of doing so is to assert that everything is covered, and that the algorithm is not broken between code changes.

    It also helps newbies to have a quick look at the unit test cases to understand the basic usecase of the algorithm.

  • Documentation inside the code is recommended. This helps others in understanding the code base.

  • Have fun!


We should also keep a curated list of resources dealing with algorithms.

Introductory Books


Online Classes


I have been "coding" since I was about 12, and have been teaching myself software engineering principles through solving problems in various languages through practice, freelance work and my own projects.

But, you see, it wasn't until a couple of years ago in high school when I started to truly see the light about how languages are merely tools; I basically realized what is common sense to me now - to truly be able to call one's self a proficient programmer, one must go beyond simple syntax slinging and be capable of efficiently solving a much wider subset of problems within computer programming than the average programmer.

Of course, this was merely one of the initial revelations that led to the revelation that ultimately led to this repository.

When I decided to become a Computer Science major, I took the initiative to research actual Computer Science topics, outside of class, as I've always been more of a self-learner.

Lo and behold, CS and practical software engineering turned out to be two entirely different things.

I won't go into my whole journey up til this point in this README, but tl;dr:

There are many problem domains which are simply closed off to the programmer who stagnates in his learning and never studies how to analyze algorithms and develop his own. This is objectively true.

I also have a much greater level of respect towards my profession now, and take it very seriously. I have a relatively rigorous base education roadmap that I've laid out for myself. Even being just a core subset of skills from which I will base subsequently developed skills on, it's quite expansive and diverse. I do not plan on stagnating, ever.

Bitdeli Badge

You can’t perform that action at this time.