Git Product home page Git Product logo

algorithms's Introduction

A repository for all Algorithms





GitHub repo size GitHub repo file count

GitHub issues GitHub pull requests GitHub GitHub forks GitHub Repo stars


Tech Stacks





Programs we have been a part of

No. Program Name Duration Deployment
1. Hacktoberfest (2022) 1st Oct 2022 - 31st Oct 2022 Algorithm
2. Social Winter of Code (2023) 1st Jan 2023 - 15th Mar 2023 Algorithm
3. Social Summer of Code (2023) 1st June 2023 - 31st July 2023 Algorithm
4. Hacktoberfest (2023) 1st Oct 2023 - 31st Oct 2023 Algorithm


Available Resources

  • The resources are categorized based on programming language. One folder for one programming language

    • Each folder has different subfolders. The subfolder represents the category algorithm belongs to
      • Each subfolder has different files. Filename represents the name of the algorithm

Arrays

No. Algorithm Name Available languages
1. Diagonal Print Algorithm in 2D Array C, C++, Java, Python
2. Fisher-Yates Algorithm C, C++, Java, Python
3. Monotonic Array C, C++, Java, Python
4. Spiral Print Matrix C, C++, Java, Python

Artificial Intelligence

No. Algorithm Name Available languages
1. A* Search Algorithm C, C++, Java, Python

Binary

No. Algorithm Name Available languages
1. Binary <-> Gray Code Conversion C, C++, Java, Python
2. Brian Kerningham's Algorithm C, C++, Java, Python
3. Hamming Code C, C++, Java, Python
4. Hamming Distance Theorem C, C++, Java, Python

Cryptography

No. Algorithm Name Available languages
1. Affine Cipher C, C++, Java, Python
2. Caesar Cipher C, C++, Java, Python
3. Columnar Transposition Cipher C, C++, Java, Python
4. Diffie - Hellman Algorithm Python
5. Elgamal Cryptosystem C, C++, Java, Python
6. Hill Cipher C, C++, Java, Python
7. Homophonic Substitution C, C++, Java, Python
8. Morse Code C, C++, Java, Python
9. Playfair Cipher C, C++, Java, Python
10. Railfence Cipher C, C++, Java, Python
11. RSA C, C++, Java, Python
12. SHA - 256 C, C++, Java, Python
13. Vernam Cipher C, C++, Java, Python
14. Vignere Cipher C++, Java, Python

Concurrent Programming

No. Algorithm Name Available languages
1. Peterson's Algorithm C, C++, Java, Python

Data Compression

No. Algorithm Name Available languages
1. Burrows-Wheeler Transform Algorithm C, C++, Java, Python
2. Huffman Coding C, C++, Java,Python
3. LZ78 Compression C, C++, Java, Python

Deadlock Avoidance

No. Algorithm Name Available languages
1. Banker's Algorithm C, C++, Java,Python

Deep Learning

No. Algorithm Name Available languages
1. Perceptron Learning - Boolean Functions Python

Divide and Conquer

No. Algorithm Name Available languages
1. Karatsuba Algorithm C++, Java, Python
2. N-Queen's Problem C, C++, Java, Python
3. Strassen's Matrix Multiplication C, C++, Java, Python

Dynamic Programming

No. Algorithm Name Available languages
1. 0/1 Knapsack C, C++, Java, Python
2. Coin change problem C, C++, Java, Python
3. Edit Distance C++
4. Fibonacci Number C, C++, Java, Python
5. Hierholzer Algorithm C, C++, Java, Python
6. Longest Common Subsequence C, C++, Java, Python
7. Matrix Chain Multiplication C, C++, Java, Python
8. Minimum Jump Algorithm C, C++, Java, Python
9. Minimum Sum Partition Problem C, C++, Java, Python
10. Partition problem C++, Java
11. Shortest Common Supersequence Problem C, C++, Java, Python
12. Travelling Salesman Problem C, C++, Java, Python

Game Theory

No. Algorithm Name Available languages
1. Grundy's Number C, C++, Java, Python

Graphics

No. Algorithm Name Available languages
1. Scanline Algorithm C++, Python

Graphs

No. Algorithm Name Available languages
1. Bellman Ford C++
2. Breadth First Search(BFS) C, C++, Java, Python
3. Dial’s Algorithm C, C++, Java, Python
4. Dijkstra C, C++, Java, Python
5. Dinic's Algorithm C++, Java, Python
6. Disjoint Set Union C, C++, Java, Python
7. Edmonds-karp Algorithm C, C++, Java, Python
8. Fleury's Algorithm C, C++, Java, Python
9. Floyd Warshall C, C++, Java, Python
10. Ford-Fulkerson Algorithm C, C++, Java, Python
11. Hamiltonian Path Java
12. Hopcroft-Karp Algorithm C, C++, Java, Python
13. Kosaraju's Algorithm C++
14. Kruskal's Algorithm C, C++, Java, Python
15. Multi Source Shortest Path C, C++, Java, Python
16. Multistage Graph (Shortest Path) C, C++, Java, Python
17. Prim's Algorithm C, C++, Java, Python
18. Stoer Wagner Algorithm C, C++, Java, Python
19. Tarjan Algorithm C, C++, Java, Python

Greedy Algorithm

No. Algorithm Name Available languages
1. Activity Selection C, C++, Java, Python
2. Egyptian Fraction C, C++, Java, Python
3. Fractional Knapsack C, C++, Java, Python
4. Job Sequencing C, C++, Java, Python
5. Merge Interval Algorithm C, C++, Java, Python
6. Optimal Merge Pattern C, C++, Java, Python

Hashing

No. Algorithm Name Available languages
1. Bloom-Filter Algorithm C, C++, Java, Python
2. Cuckoo Hashing C, C++, Java, Python

Image Processing

No. Algorithm Name Available languages
1. Canny Edge Detection C, C++, Java, Python

Job Scheduling

No. Algorithm Name Available languages
1. First Come First Serve C, C++, Java, Python
2. Highest Response Ratio Next C, C++, Java, Python
3. Priority Scheduling C, C++, Java, Python
4. Round Robin Scheduling C, C++, Java, Python
5. Shortest Job First C, C++, Java, Python

Linked List

No. Algorithm Name Available languages
1. Addition of two Linked Lists C, C++, Java, Python
2. Circular Linked List C, C++, Java, Python
3. Detect loop in a Linked List C++
4. Doubly Linked List C, C++, Java, Python
5. Intersection of two Linked Lists C, C++, Java, Python
6. Length of Linked List C, C++, Java, Python
7. LRU Cache Design C, C++, Java, Python
8. Merge Two Sorted Linked List C, C++, Java, Python
9. Merge K Sorted Linked List C, C++, Java, Python
10. Palindrome Linked List C, C++, Java, Python
11. Reverse Linked List C, C++, Java, Python
12. Reverse Linked List in a Group of K C, C++, Java, Python
13. Singly Linked List C, C++, Java, Python
14. Sorting Linked List C, C++, Java, Python

Machine Learning

No. Algorithm Name Available languages
1. Decision Tree Python
2. Feed-Forward Neural Network C++
3. K-Means Clusters C, C++, Python
4. K-Nearest Neighbours C, C++, Java, Python
5. Linear Regression C, C++, Java, Python
6. Logistic Regression C, C++, Java, Python
7. Naive Bayes C++, Python

Maths

No. Algorithm Name Available languages
1. Armstrong Numbers C, C++, Java, Python
2. Binary Exponentiation C, C++, Java, Python
3. Binomial Theorem C, C++, Java, Python
4. Bennett's Formula C, C++, Java, Python
5. Bentley-Ottmann Algorithm C, C++, Java, Python
6. Bisection Algorithm C, C++, Java, Python
7. Chinese Remainder Theorem C, C++, Java, Python
8. Chudnovsky Algorithm C, C++, Java, Python
9. Closures of Relations C, C++, Java, Python
10. Congruency of Triangle C, C++, Java, Python
11. Decimal <-> Binary Converter C, C++, Java, Python
12. Extended Euclidean Algorithm C, C++, Java, Python
13. Euler's Totient Function C, C++, Java, Python
14. Factorial of Number C, C++, Java, Python
15. Factors C, C++, Java, Python
16. Frievald's Algorithm C, C++, Java, Python
17. GCD & LCM C, C++, Java, Python
18. Heron's Formula C, C++, Java, Python
19. Interquartile Ranges C, C++, Java, Python
20. Josephus Problem C, C++, Java, Python
21. Klee's Algorithm C, C++, Java, Python
22. Lucas Lehmer Series C, C++, Java, Python
23. Luhn's Algorithm C, C++, Java, Python
24. Manhattan Distance C, C++, Java, Python
25. Modular Exponentiation C, C++, Java, Python
26. Pascal's Triangle C, C++, Java, Python
27. Perfect Number C, C++, Java, Python
28. Power-set of Elements C, C++, Java, Python
29. Prefix-Postfix-Infix Interconversion C++, Python
30. Prime Number C, C++, Java, Python
31. Quickhull Algorithm C ,C++, Java, Python
32. Reverse Integer C, C++, Java, Python
33. Roman to Decimal converter C, C++, Java, Python
34. Russian Peasant Algorithm C, C++, Java, Python
35. Shri Dharayacharya Algorithm C, C++, Java, Python
36. Sieve Eratosthenes Algorithm C, C++, Java,Python
37. Similar Triangles C, C++, Java, Python
38. Strong Number C, C++, Java, Python
39. Sudoku Solver C, C++, Java, Python
40. Zeller's Algorithm C, C++, Java, Python

Memory Allocation

No. Algorithm Name Available languages
1. Best Fit Algorithm C, C++, Java, Python
2. Next Fit Algorithm C, C++, Java, Python
3. Worst Fit Algorithm C, C++, Java, Python

Optimization

No. Algorithm Name Available languages
1. Ant Colony Optimization Python
2. Genetic Algorithm C++, Python
3. Gradient Descent Python
4. Grey Wolf Optimization C, C++, Java, Python
5. Hill Climbing Algorithm C, C++, Java, Python
6. Particle Swarm Optimization C++, Python
7. Shuffled Frog Leaping Algorithm C++, Python
8. Simulated Annealing C++, Python

Pattern Matching

No. Algorithm Name Available languages
1. Aho-Corasick Algorithm C, C++, Java, Python
2. Boyer Moore Algorithm C, C++, Java, Python
3. KMP Algorithm C, C++, Java, Python
4. Rabin Karp C, C++, Java, Python
5. Z - Algorithm C, C++, Java, Python

Recursion

No. Algorithm Name Available languages
1. String Permutation C, C++, Java, Python
2. Tower of Hanoi C, C++, Java, Python

Searching

No. Algorithm Name Available languages
1. Binary Search on 2D Matrix C,C++, Java, Python
2. Binary Search C, C++, Java, Python
3. Exponential Search C, C++, Java, Python
4. Fibonacci Search C, C++, Java, Python
5. Interpolation Search C, C++, Java, Python
6. Jump Search C, C++, Java, Python
7. Linear Search C, C++, Java, Python
8. Order Agnostic Binary Search C, C++, Java, Python
9. Quick Select C, C++, Java, Python
10. Sublist Search C, C++, Java, Python
11. Ternary Search C, C++, Java, Python

Sorting

No. Algorithm Name Available languages
1. 3 Sum Problem C, C++, Java, Python
2. Bead Sort C, C++, Java, Python
3. Bidirectional Selection Sort C, C++, Java, Python
4. Bingo Sort C, C++, Java, Python
5. Bogo Sort C, C++, Java, Python
6. Bubble Sort C, C++, Java, Python
7. Bucket Sort C, C++, Java, Python
8. Comb Sort C, C++, Java, Python
9. Counting Sort C, C++, Java,Python
10. Cyclic Sort C, C++, Java, Python
11. Cocktail Sort C, C++, Java, Python
12. Dutch National Flag C, C++, Java, Python
13. Gnome Sort C, C++, Java, Python
14. Heap Sort C, C++, Java, Python
15. Insertion Sort C, C++, Java, Python
16. Intro Sort C, C++, Java, Python
17. Merge Sort C, C++, Java, Python
18. Odd-Even Sort / Brick Sort C, C++, Java, Python
19. Pancake Sort C, C++, Java, Python
20. Pigeon-Hole Sort C, C++, Java, Python
21. Quick Sort C, C++, Java, Python
22. Radix Sort C, C++ Java, Python
23. Randomized Quick Sort C, C++, Java, Python
24. Selection Sort C, C++, Java, Python
25. Shell Sort C, C++, Java, Python
26. Stooge Sort C, C++, Java, Python
27. Tim Sort C, C++, Java, Python
28. Topological Sort C++
29. Wave Sort C++, Java, Python

Stacks

No. Algorithm Name Available languages
1. Max Area in Histogram C, C++, Java, Python
2. Next Greater Element C, C++, Java, Python
3. Rain Water Problem C, C++, Java, Python
4. Stack Using Priority Queue C, C++, Java, Python

Strings

No. Algorithm Name Available languages
1. Beautiful String Algorithm C, C++, Java, Python
2. Camel Case Algorithm C, C++, Java, Python
3. Manacher's Algorithm C, C++, Java, Python

Sub-Arrays

No. Algorithm Name Available languages
1. Boyer-Moore Majority Voting C, C++, Java, Python
2. Kadane's Algorithm C, C++, Java, Python
3. Shortest Unsorted Continuous Sub-Arrays C, C++, Java, Python

Trees

No. Algorithm Name Available languages
1. AO* Tree C++, Java, Python
2. AVL Tree C, C++, Java, Python
3. B+ Tree C, C++, Java, Python
4. Binary Search Tree C, C++
5. Binary Tree to BST C, C++, Java, Python
6. Binary Tree Views(Left, Right, Top, Bottom) C, C++, Java, Python
7. Fenwik Tree C, C++, Java, Python
8. Min-Indexed D-Heap Algorithm C, C++, Java, Python
9. Morris Traversal C, C++, Python
10. Red-Black Tree C++, Java, Python
11. Segment Tree C, C++, Java, Python
12. Splay Trees C, C++, Java, Python
13. Symmetric Tree Algorithm C, C++, Java, Python
14. Ternary Search Tree C, C++, Java, Python
15. Treap C, C++, Java, Python
16. Tree Traversal C, C++, Java, Python
17. Trie C, C++, Java, Python
18. Van Emde Boas Tree C, C++, Java, Python

Contributors 🫂


Steps for Contributing 🚀

Refer to this YouTube Video for reference!


  • Fork the Repo
  • Clone the forked Repo by typing the following commands in the terminal
$ git clone https://github.com/<your-github-username>/Algorithms.git

$ cd Algorithms
  • Now to add your resource to website, add an object with keys same as listed in existing objects in the file.
  • Save and commit your code.
  • Push to your fork of the repository , navigate to original repository and make a pull request.

Screenshot 2022-10-23 at 8 03 11 AM
Screenshot 2022-10-23 at 8 03 31 AM
$ git clone https://github.com/<your-github-username>/Algorithms.git

$ cd algorithms
  • Create a Branch using:
$ git checkout -b <new-branch-name>
  • Make changes to the code(for ex- add an update route)

  • To see modified changes

$ git status
  • Stage your changes using:
$ git add .
  • Commit your changes using:
$ git commit -m "add any comment"
  • Push the changes to the forked repository using:
$ git push origin <new-branch-name>
  • Navigate to the original repository and make a pull request
  • In case of merge conflict fetch and merge from the remote repository

Please don't forget to update the Available Resources section

Happy?? Star ⭐ this Repo. 🤩

algorithms's People

Contributors

aarsh30 avatar abhilash1781 avatar aniketgupta03 avatar atul1510 avatar ayatisonkar avatar devchawla2608 avatar dharnish38 avatar goyalh4164 avatar harshit-raj-14 avatar kapil4457 avatar kritika2313 avatar kumar-laxmi avatar manavlohia945 avatar mvpamansingh avatar nikita06211 avatar nikitagupta-17 avatar papri24majumder avatar paritosh-j avatar ranjanmangla1 avatar rayarka26 avatar sha0urya avatar shravanii2308 avatar shubh08am avatar sinhasaurabh079 avatar stiwari-ds avatar sumitkr2000 avatar swastik-akhil avatar tarunvyshnav777 avatar vijay-kumar-yadav avatar viveksondhiya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

algorithms's Issues

Kadane's Algorithm

The algorithm is available is the following language:

  • C
  • C++
  • Python
  • Java

Prim's Algorithm

Implement Prim's Algorithm in the following languages:

  • C
  • C++
  • Java
  • Python

Merge Sort

Implementation of merge sort in all 4 languages C, C++, Java, Python.

Heap Sort

Heap Sort implementation in C, C++, Python and Java. Kindly accept my issue for the same.

Bellman Ford's Algorithm

Is your feature request related to a problem? Please describe.
This is a graph algorithm to check for the negative cycle.

Describe the solution you'd like
I would like to add this algorithm to this repo in C++ language.

Kindly assign me this task.

Counting Sort

Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values (kind of hashing). Then doing some arithmetic to calculate the position of each object in the output sequence.

Floyd-Warshall Algorithm

Hello , I'm a SWOC contributor . I would like to create a new issue .
The Floyd-Warshall algorithm is also known as All pairs shortest path algorithm is used to find all pair shortest path problem from a given weighted graph.
In the end it will generate a matrix, which will represent the minimum distance from any node to all other nodes in the graph.
The time complexity for this algorithm is O(V*3) --> Here V represents the number of vertices in the given graph .
I will provide the C program (explicit) for the above algorithm . The output not only consists of the result but also the step by step solution .

The infinity is represented as 999

Can I contribute

AVL Trees

Implement AVL Tree using the following four languages:

  • C
  • C++
  • Python
  • Java

Red-Black Trees

This algorithm is available in the following languages:

  • C
  • Java

Binary Search Tree

This algorithm is available in the following languages:

  • C++
  • Java
  • Python

divide_and_conquer

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Topological Sort

Is your feature request related to a problem? Please describe.
Topological Sort is a graph algorithm

Describe the solution you'd like
I would like to add an algorithm for topological sort to this repo in C++ language.

Kindly assign me this task

Kruskal's Algorithm

Is your feature request related to a problem? Please describe.
This is a graph algorithm that uses DSU to make a Minimum Spanning Tree.

Describe the solution you'd like
I would like to add this algorithm to this repo in C++ language.

Kindly assign me this task.

Bring symmetry to filenames of same algorithm

As of now, the filenames are not aligning to a particular pattern or notation or convention

  • Algorithm files across a category should be same so that it helps in documentation
  • For the long term, to have easy maintenance, we should declare a standard convention for naming files/folders and ask the community to adhere to it while making contributions
    • This preserves the symmetry among files and helps in easy maintenance

Kadane's Algorithm

Kadane's Algorithm implementation in C++, Python and Java. Kindly accept my issue for the same.

Binary Tree Traversals

Assign it to me. I will make Valuable contribution on all the types of traversals including zig-zag Traversal also

Linear Search

Implement Linear Search and Binary Search in the following four languages:

  • C
  • C++
  • Python
  • Java

Add Info about available algorithms in main Readme

  • I think it becomes easier for the community to use the repository if we add the available algorithms across languages in Readme.
  • Further, it would be good if we ask the new contributors to add their implementation in Readme alongside their contributions
    • It ensures automatic update of Readme with the available resources

Huffman Coding

Huffman Coding is available in the following language:

  • Java

Huffman Coding

Huffman Coding implementation in C++, Python and Java. Kindly accept my issue for the same.

Kosaraju's Algorithm

Is your feature request related to a problem? Please describe.
Kosaraju's Algorithm is a graph algorithm to check for Strongly Connected Components.

Describe the solution you'd like
I would like to add this algorithm to this repo in C++ language.

Kindly assign me this task

Bubble Sort

Implement Bubble Sort in any of the four language:

  • C
  • C++
  • Python
  • Java

Quick Sort

QuickSort is a Divide and Conquer algorithm.
It picks an element as pivot and partitions the given array around the picked pivot(in case of lomuto partition).
There are many different versions of quickSort that pick pivot in different ways:-

  1. Lometo Partition
  2. Hoare Partition
    - definition GFG

AVL Trees

This algorithm is available in the following languages:

  • C
  • Java

Travelling Salesman Algorithm (Dynamic Programming)

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Rabin Karp Algorithm

Rabin-Karp algorithm is an algorithm used for searching/matching patterns in the text using a hash function. Unlike Naive string matching algorithm, it does not travel through every character in the initial phase rather it filters the characters that do not match and then performs the comparison.

This algorithm is available in the following language:

  • C
  • C++
  • Java
  • Python

Karatsuba Algorithm

Karatsuba Algorithm is available in the following languages:

  • C
  • C++
  • Java
  • Python

Please include this in folder named: Divide-and-Conquer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.