Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/iiitv/algos

Popular Algorithms and Data Structures implemented in popular languages
https://github.com/iiitv/algos

algorithm algorithm-challenges algorithms code-list codes data-structures hacktoberfest

Last synced: 11 days ago
JSON representation

Popular Algorithms and Data Structures implemented in popular languages

Lists

README

        

# Algos

Community (college) maintained list of Algorithms and Data Structures implementations.

[![Join the chat at https://gitter.im/iiitv/algos](https://badges.gitter.im/iiitv/algos.svg)](https://gitter.im/iiitv/algos?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](https://travis-ci.org/iiitv/algos.svg?branch=master)](https://travis-ci.org/iiitv/algos)
[![GitHub issues](https://img.shields.io/github/issues/iiitv/algos.svg)](https://github.com/iiitv/algos/issues)
[![Open Source Love](https://badges.frapsoft.com/os/v3/open-source.svg?v=102)](https://github.com/iiitv/algos/)
[![LICENSE Love](https://img.shields.io/npm/l/awesome-badges.svg)](https://github.com/iiitv/algos/blob/master/LICENSE)

[![js-happiness-style](https://cdn.rawgit.com/JedWatson/happiness/master/badge.svg)](https://github.com/JedWatson/happiness)

## Implemented Algorithms

| Algorithm | C | CPP | Java | Python | Golang | JavaScript | C# |
|:--------------|:----------------:|:----------------:|:----------------:|:-----------------:|:-----------------:|:-----------------:| :-----------------:|
| [Bin Sort](http://www.cdn.geeksforgeeks.org/bucket-sort-2/)| [:white_check_mark:](bin_sort/bin_sort.c) | |[:white_check_mark:](bin_sort/BinSort.java) | [:white_check_mark:](bin_sort/bin_sort.py) | [:white_check_mark:](bin_sort/bin_sort.go) | | |
| [Binary Search](https://en.wikipedia.org/wiki/Binary_search_algorithm) | [:white_check_mark:](binary_search/binary_search.c) | | [:white_check_mark:](binary_search/BinarySearch.java) | [:white_check_mark:](binary_search/binary_search.py) | [:white_check_mark:](binary_search/binary_search.go) | [:white_check_mark:](binary_search/binarySearch.js) | [:white_check_mark:](binary_search/BinarySearch.cs) |
| [Breadth First Search](https://en.wikipedia.org/wiki/Breadth-first_search) | |[:white_check_mark:](breadth_first_search/BreadthFirstSearch.cpp) | [:white_check_mark:](breadth_first_search/BreadthFirstSearch.java) |[:white_check_mark:](breadth_first_search/breadth_first_search.py) | | | |
| [Breadth First Traversal](https://www.geeksforgeeks.org/breadth-first-search-or-bfs-for-a-graph/) | |[:white_check_mark:](breadth_first_traversal/breadth_first_traversal.cpp) | [:white_check_mark:](breadth_first_traversal/breadthFirstTraversal.java) |[:white_check_mark:](breadth_first_traversal/breadth_first_traversal.py) | | | |
| [Coin Change Problem](http://www.algorithmist.com/index.php/Coin_Change) | [:white_check_mark:](coin_change_problem/coin_change_problem.c) | | [:white_check_mark:](coin_change_problem/CoinChangeProblem.java) | [:white_check_mark:](coin_change_problem/coin_change_problem.py) | [:white_check_mark:](coin_change_problem/coin_change_problem.go) | [:white_check_mark:](coin_change_problem/coinChangeProblem.js) | |
| [Counting Sort](http://www.geeksforgeeks.org/counting-sort/)| [:white_check_mark:](counting_sort/counting_sort.c) | | [:white_check_mark:](counting_sort/CountingSort.java) | [:white_check_mark:](counting_sort/counting_sort.py) | [:white_check_mark:](counting_sort/counting_sort.go) | [:white_check_mark:](counting_sort/countingSort.js) | [:white_check_mark:](counting_sort/CountingSort.cs) |
| [Depth First Traversal](http://www.geeksforgeeks.org/depth-first-traversal-for-a-graph/) | | | [:white_check_mark:](depth_first_traversal/DepthFirstTraversal.java) | [:white_check_mark:](depth_first_traversal/DepthFirstTraversal.py) | | | |
| [Dijkstra Algorithm](https://en.wikipedia.org/wiki/Dijkstra's_algorithm) | [:white_check_mark:](dijkstra/dijkstra.c) | | [:white_check_mark:](dijkstra/Dijkstra.java) | [:white_check_mark:](dijkstra/dijkstra.py) | |[:white_check_mark:](dijkstra/dijkstra.js) | |
| [Euclidean GCD](https://en.wikipedia.org/wiki/Euclidean_algorithm) | [:white_check_mark:](euclidean_gcd/euclidean_gcd.c) | | [:white_check_mark:](euclidean_gcd/EuclideanGCD.java) | [:white_check_mark:](euclidean_gcd/euclidean_gcd.py) | [:white_check_mark:](euclidean_gcd/euclidean_gcd.go) | [:white_check_mark:](euclidean_gcd/euclideanGCD.js) | [:white_check_mark:](euclidean_gcd/EuclideanGCD.cs) |
| [Exponentiation by Squaring](https://en.wikipedia.org/wiki/Exponentiation_by_squaring) | [:white_check_mark:](exponentiation_by_squaring/exponentiation_by_squaring.c) | | [:white_check_mark:](exponentiation_by_squaring/ExponentiationBySquaring.java) | [:white_check_mark:](exponentiation_by_squaring/exponentiation_by_squaring.py) | [:white_check_mark:](exponentiation_by_squaring/exponentiation_by_squaring.go) | [:white_check_mark:](exponentiation_by_squaring/exponentiationBySquaring.js) | |
| [Heap Sort](https://en.wikipedia.org/wiki/Heapsort) | [:white_check_mark:](heap_sort/heap_sort.c) |[:white_check_mark:](heap_sort/heapsort.cpp) | [:white_check_mark:](heap_sort/HeapSort.java) | [:white_check_mark:](heap_sort/heap_sort.py) | | [:white_check_mark:](heap_sort/heapSort.js) | |
| [Insertion Sort](https://en.wikipedia.org/wiki/Insertion_sort) | [:white_check_mark:](insertion_sort/insertion_sort.c) |[:white_check_mark:](insertion_sort/insertion_sort.cpp) | [:white_check_mark:](insertion_sort/InsertionSort.java)| [:white_check_mark:](insertion_sort/insertion_sort.py) | [:white_check_mark:](insertion_sort/insertion_sort.go) | [:white_check_mark:](insertion_sort/insertionSort.js) | [:white_check_mark:](insertion_sort/InsertionSort.cs) |
| [k-NN](https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm) | | | | [:white_check_mark:](k_nn/k_nn.py) | | | |
| [Largest Sum Contiguous Subarray](http://www.geeksforgeeks.org/largest-sum-contiguous-subarray/) | [:white_check_mark:](largest_sum_contiguous_subarray/largestSumContiguousSubarray.c) | | [:white_check_mark:](largest_sum_contiguous_subarray/LargestSumContiguousSubarray.java) | [:white_check_mark:](largest_sum_contiguous_subarray/largest_sum_contiguous_subarray.py) | [:white_check_mark:](largest_sum_contiguous_subarray/largestSumContiguousSubarray.go) | [:white_check_mark:](largest_sum_contiguous_subarray/largestSumContiguousSubarray.js) | |
| [Linear Regression](https://en.wikipedia.org/wiki/Linear_regression) | | | | [:white_check_mark:](linear_regression/linear_regression.py) | | | |
| [Linear Search](https://en.wikipedia.org/wiki/Linear_search) | [:white_check_mark:](linear_search/linear_search.c) | | [:white_check_mark:](linear_search/LinearSearch.java) | [:white_check_mark:](linear_search/linear_search.py) | [:white_check_mark:](linear_search/linear-search.go) | [:white_check_mark:](linear_search/linearSearch.js) | [:white_check_mark:](linear_search/LinearSearch.cs) |
| [Longest Common Subsequence](http://www.geeksforgeeks.org/dynamic-programming-set-4-longest-common-subsequence) | [:white_check_mark:](longest_common_subsequence/longestCommonSubsequence.c) | | [:white_check_mark:](longest_common_subsequence/LongestCommonSubsequence.java) | [:white_check_mark:](longest_common_subsequence/longest_common_subsequence.py) | [:white_check_mark:](longest_common_subsequence/longestCommonSubsequence.go) | [:white_check_mark:](longest_common_subsequence/longestCommonSubsequence.js) | |
| [Longest Palindromic Substring](http://www.geeksforgeeks.org/longest-palindrome-substring-set-1/) | | [:white_check_mark:](longest_palindromic_substring/longest_palindromic_substring.cpp) | [:white_check_mark:](longest_palindromic_substring/LongestPalindromicSubstring.java) | [:white_check_mark:](longest_palindromic_substring/longest_palindromic_substring.py) | [:white_check_mark:](longest_palindromic_substring/longest_palindromic_substring.go) | [:white_check_mark:](longest_palindromic_substring/longestPalindromicSubstring.js) | |
| [Merge Sort](https://www.khanacademy.org/computing/computer-science/algorithms/merge-sort/a/overview-of-merge-sort) | [:white_check_mark:](merge_sort/merge_sort.c) | | [:white_check_mark:](merge_sort/MergeSort.java) | [:white_check_mark:](merge_sort/merge_sort.py) | [:white_check_mark:](merge_sort/merge_sort.go) | [:white_check_mark:](merge_sort/mergeSort.js) | [:white_check_mark:](merge_sort/MergeSort.cs) |
| [Modular Exponential](http://www.geeksforgeeks.org/modular-exponentiation-power-in-modular-arithmetic/) | [:white_check_mark:](modular_exponential/modular_exponential.c) | | [:white_check_mark:](modular_exponential/ModularExponential.java) | [:white_check_mark:](modular_exponential/modular_exponential.py) | [:white_check_mark:](modular_exponential/modular_exponential.go) | [:white_check_mark:](modular_exponential/modularExponential.js) | |
| [Nth Fibonacci Number](https://en.wikipedia.org/wiki/Fibonacci_number) |[:white_check_mark:](fibonacci_number/FibonacciNumber.c) | | [:white_check_mark:](fibonacci_number/FibonacciNumber.java) | | |[:white_check_mark:](fibonacci_number/FibonacciNumber.js) | |
| [N-Queen Problem](https://en.wikipedia.org/wiki/Eight_queens_puzzle) | | [:white_check_mark:](n_queen_problem/NQueenProblem.cpp) | [:white_check_mark:](n_queen_problem/NQueenProblem.java) | [:white_check_mark:](n_queen_problem/n_queen_problem.py) | [:white_check_mark:](n_queen_problem/n_queen_problem.go) | | |
| [Prime Factor](https://en.wikipedia.org/wiki/Prime_factor) | [:white_check_mark:](prime_factor/prime_factor.c) | | [:white_check_mark:](prime_factor/PrimeFactor.java) | [:white_check_mark:](prime_factor/prime_factor.py) | [:white_check_mark:](prime_factor/prime_factor.go) | [:white_check_mark:](prime_factor/primeFactor.js) | |
| [Prims](https://en.wikipedia.org/wiki/Prim%27s_algorithm) | [:white_check_mark:](prims/prims.c) | | [:white_check_mark:](prims/Prims.java) | | [:white_check_mark:](prims/prims.go) | [:white_check_mark:](prims/prims.js) | |
| [Quick Select](https://en.wikipedia.org/wiki/Quickselect) | [:white_check_mark:](quick_select/quick_select.c) | | [:white_check_mark:](quick_select/QuickSelect.java) | [:white_check_mark:](quick_select/quick_select.py) | | | |
| [Quicksort](https://en.wikipedia.org/wiki/Quicksort) | [:white_check_mark:](quick_sort/quicksort.c) | | [:white_check_mark:](quick_sort/QuickSort.java) | [:white_check_mark:](quick_sort/quick_sort.py) | [:white_check_mark:](quick_sort/quick_sort.go) | [:white_check_mark:](quick_sort/quickSort.js) | [:white_check_mark:](quick_sort/QuickSort.cs) |
| [Radix Sort](http://www.geeksforgeeks.org/radix-sort/) | [:white_check_mark:](radix_sort/radix_sort.c) | | [:white_check_mark:](radix_sort/RadixSort.java) | [:white_check_mark:](radix_sort/radix_sort.py) | | | |
| [Rod Cutting Problem](http://www.geeksforgeeks.org/dynamic-programming-set-13-cutting-a-rod/) | [:white_check_mark:](rod_cutting_problem/rod_cutting.c) | | [:white_check_mark:](rod_cutting_problem/RodCutting.java) | [:white_check_mark:](rod_cutting_problem/rod_cutting.py) | [:white_check_mark:](rod_cutting_problem/rod_cutting.go) | [:white_check_mark:](rod_cutting_problem/rodCuttingProblem.js) | |
| [Shell Sort](https://en.wikipedia.org/wiki/Shellsort) | | [:white_check_mark:](shell_sort/ShellSort.cpp) | [:white_check_mark:](shell_sort/ShellSort.java) | [:white_check_mark:](/shell_sort/shell_sort.py) | [:white_check_mark:](shell_sort/shell_sort.go) | [:white_check_mark:](shell_sort/shellSort.js) | [:white_check_mark:](shell_sort/ShellSort.cs) |
| [Sieve of Eratosthenes](https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes) | [:white_check_mark:](sieve_of_eratosthenes/sieveOfEratosthenes.c) | | [:white_check_mark:](sieve_of_eratosthenes/SieveOfEratosthenes.java) | [:white_check_mark:](sieve_of_eratosthenes/sieve_of_eratosthenes.py) | [:white_check_mark:](sieve_of_eratosthenes/sieve_of_eratosthenes.go) | [:white_check_mark:](sieve_of_eratosthenes/sieveOfEratosthenes.js) | |
| [Sleep Sort](http://www.geeksforgeeks.org/sleep-sort-king-laziness-sorting-sleeping/) | | [:white_check_mark:](sleep_sort/sleep_sort.cpp) | [:white_check_mark:](sleep_sort/SleepSort.java) | [:white_check_mark:](sleep_sort/sleep_sort.py) | [:white_check_mark:](sleep_sort/sleep_sort.go) | | | |

## Implemented Data Structures

| Data Structure | C | CPP | Java | Python | Golang | JavaScript | C# |
|:--------------|:----------------:|:----------------:|:----------------:|:-----------------:|:-----------------:|:-----------------:|:-----------------:|
| [AVL Tree](http://www.geeksforgeeks.org/avl-tree-set-1-insertion)|[:white_check_mark:](avl_tree/avl_tree.c)| |[:white_check_mark:](avl_tree/AvlTree.java) | | | | |
| [Binary Search Tree](https://en.wikipedia.org/wiki/Binary_search_tree) | | | [:white_check_mark:](binary_search_tree/BinarySearchTree.java) | [:white_check_mark:](binary_search_tree/BinarySearchTree.py) | [:white_check_mark:](binary_search_tree/binary_search_tree.go) | | |
| [Linked List](https://en.wikipedia.org/wiki/Linked_list) | [:white_check_mark:](linked_list/linkedList.c.c) | | [:white_check_mark:](linked_list/LinkedList.java) | [:white_check_mark:](linked_list/linked_list.py) | [:white_check_mark:](linked_list/linked_list.go) | [:white_check_mark:](linked_list/linkedList.js) | [:white_check_mark:](linked_list/LinkedList.cs) |
| [Queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) | |[:white_check_mark:](queue/queue.cpp)| [:white_check_mark:](queue/Queue.java) | [:white_check_mark:](queue/queue.py) | | | |
| [Stack](https://en.wikipedia.org/wiki/Stack_(abstract_data_type)) | [:white_check_mark:](stack/stack.c) | | [:white_check_mark:](stack/Stack.java) | [:white_check_mark:](stack/stack.py) | [:white_check_mark:](stack/stack.go) | [:white_check_mark:](stack/stack.js) | [:white_check_mark:](stack/Stack.cs) |
| [Trie](https://en.wikipedia.org/wiki/Trie) | | [:white_check_mark:](trie/trie.cpp) | [:white_check_mark:](trie/Trie.java) | | [:white_check_mark:](trie/trie.go) | | [:white_check_mark:](trie/Trie.cs) | |

## How to run them

| Language | Steps |
|:--------------|:----------------|
| C |

gcc [filename.c]
./a.out # unix
a.exe # windows
|
| CPP |
g++ [filename.cpp]
./a.out # unix
a.exe # windows
|
| Java |
javac [filename.java]
java [filename]
|
| Python |
python [filename.py]
|
| Golang |
go run [filename.go]
|
| JavaScript |
node [filename.js]
|
| C# |
mcs [filename.cs]
mono [filename.exe]
|

## Resources

* [Algorithms - Learneroo](https://www.learneroo.com/subjects/8)
* [Awesome-Algorithms](https://github.com/tayllan/awesome-algorithms)
* [Algorithms List - GeeksforGeeks](http://www.geeksforgeeks.org/fundamentals-of-algorithms/)
* [Intro to Algorithms - Khan Academy](https://www.khanacademy.org/computing/computer-science/algorithms)
* [Popular Data Structures and Algorithms - Codechef](https://discuss.codechef.com/questions/48877/data-structures-and-algorithms)
* [Stanford-ACM-Codes](https://github.com/jaehyunp/stanfordacm) - A list of codes written by previous Stanford ACM team members and coaches.
* [Data Structures and Algorithms](https://hackr.io/tutorials/learn-data-structures-algorithms) - A user ranked list of online tutorials to learn Data Structures and Algorithms online.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).

If you plan to suggest a new algorithm or DS, please make sure to read [the guidelines](CONTRIBUTING.md#sa).

## Credits

Idea by [@Monal5031](https://github.com/Monal5031)

## Project Maintainers

* [Avi Aryan](https://github.com/aviaryan)
* [Pratyush Singh](https://github.com/singhpratyush)

Only project maintainers should merge a PR. Other members can add their reviews to a PR but the merging should be done by only a project maintainer.