A repository of the various popular algorithms I have coded in C++ and Python.
There is meta information like problem description and tutorial at the top of each program file. Some additional algorithms are present at my data structures repository.
Note: Those without links will be uploaded soon.
- Merge Sort
- Selection Sort
- Instertion Sort
- Quick Sort
- Strassens Matrix Multiplication
Optimization problem by making locally best decisions.
- Knapsack
- Job Sequencing with Deadlines
- Optimal File Merge Pattern / Huffman Coding
- Prim's Algorithm
- Kruskal Algorithm
Optimization problem by checking all possible solutions- brute force technique.
- 0/1 Knapsack Problem
- Coin Change
- Travelling Salesman Problem
- Longest Common Subsequence
- Subset Sum Problem
- Matrix Chain Multiplication
- Floyd Warshal
- Weighted Job Sheduling
- Bellman Ford
- Multistage Graph | Recursion Solution
- Reliability Design
- Longest palindromic subsequence
- Minimum subset sum difference | In Python
Using DFS to generate various feasible solutions by brute force technique.
Using BFS to generate various feasible solutions by brute force technique.
- Job Sequencing with Deadline
- 0/1 Knapsack
- Travelling Salesman Problem
- Articulation Point and Biconnected Components
- Cycle in Undirected Graph
- Cycle in Directed Graph
- Kosarajus Algorithm
- Disjoint Sets
- Topological Sort
- Lowest Common Ancestor
- Fenwick Tree
- Z Algorithm Z Values
- Manacher's Algorithm
- Find even/odd | Tutorial
- Swap two numbers | Tutorial
- Mask ith bit to find, set and clear | Tutorial
- Find number of bits to change to convert a to b | Tutorial
- Find the only non-repeating element in an array where every other element repeats twice | Tutorial
- Find the two non-repeating elements in an array where every other element repeats twice | Tutorial
- Find the only non-repeating element in an array where every other element repeats k times | Tutorial
- Range Minimum Query using Segment tree
- Range Minimum Query using Sparse Table
- Convex Hull