-
Notifications
You must be signed in to change notification settings - Fork 311
Algorithms (old)
Sahil edited this page Jun 4, 2020
·
1 revision
This list contains the algorithms that are present in the repository or those which can be implemented/explained in blog post.
| Title | cpp | java | python | blog post |
|---|---|---|---|---|
| Linear Search | linear-search-cpp | linear-search-py | ||
| Binary Search | binary-search-cpp | binary-search-py | ||
| Interpolation Search | interpolation-search-py | |||
| Fibonacci Search | ||||
| Exponential Search | exponential-search-py | |||
| Jump Search | jump-search-py | |||
| Binary Search STL |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Insertion Sort | insertion-sort-cpp | insertion-sort-py | |||
| Bubble Sort | bubble-sort-cpp | bubble-sort-py | |||
| Selection Sort | selection-sort-cpp | ||||
| Heap Sort | heap-sort-c | ||||
| Merge Sort | merge-sort-cpp | ||||
| Quick Sort | quick-sort-cpp | ||||
| Wave Sort | wave-sort-java | ||||
| Bucket Sort | bucket-sort-cpp | ||||
| Counting Sort | counting-sort-cpp | ||||
| Radix Sort | radix-sort-cpp | ||||
| Sort in STL |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Activity Selection | activity-selection-cpp | ||||
| Huffman Coding | huffman-coding-cpp | ||||
| Knapsack Greedy | knapsack-greedy-c | ||||
| Kruskal's Algorithm | kruskal-cpp | ||||
| Coin Change Greedy | coin-change-java | ||||
| Egyptian fraction | egyptian-fractions-cpp | egyptian-fractions-py | |||
| Job-sequencing |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Chess | chess-java | ||||
| Power Set | power-set-cpp | ||||
| Subset Sum to K | subset-sum-k-cpp | ||||
| Replace PI | n-queen-cpp |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| CrossWord | cross-word-java | ||||
| Sudoku | sudoku-java | ||||
| Tower of Hanoi | tower-of-hanoi-cpp | ||||
| N Queen's | n-queen-cpp | n-queen-py | |||
| Permutations | permutation-cpp | ||||
| Tug of War | |||||
| Knight's Tour | |||||
| Rat in a maze | |||||
| Hamiltonian | |||||
| Cryptarithmetic |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Cuckoo Hashing | cuckoo-hashing | ||||
| Union and Intersection of two linked lists | |||||
| Count maximum no. of points on same line | |||||
| Find pairs in array whose modulo is K | |||||
| Clone a binary tree with random pointers |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Balanced Parenthesis Problems | bal-parenthesis | bal-parenthesis-py | |||
| Prefix, Postfix, Infix conversions | |||||
| Next greater element problem | |||||
| Reverse and Sorting of a stack | |||||
| Find maximum difference between nearest left and right smaller elements |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Count total set bits in all numbers from 1 to n | count-setbits-all | ||||
| Modular fast exponentiation | modular-exp | ||||
| Smallest power of 2 greater than or equal to n | |||||
| Program for all bitwise tricks |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Convex Hull | convex-hull-cpp | ||||
| Karatsuba Algorithm | karatsuba-cpp | ||||
| Median Finding | median-finding-cpp | ||||
| Weighted Job Scheduling | weighted-job-sched-dc-cpp | ||||
| Counting Inversions | |||||
| Closest pair of Points | closest-pair-of-points-cpp | closest-pair-of-points-py | |||
| Strassen's Algorithm |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Fibonacci Number | fibonacci-cpp | ||||
| Max 1D Range Sum | kadane-cpp | ||||
| Max 2D Range Sum | matrix-sum-dp-cpp | ||||
| Longest Increasing Subsequence (LIS) | lis-cpp | ||||
| 0-1 Knapsack | knapsack-dp-cpp | ||||
| Coin Change | |||||
| Traveling Salesman Problem | tsp-dp-cpp | ||||
| Rod Cutting Problem | rod-cutting-cpp | ||||
| Matrix Chain Multiplication | |||||
| Edit Distance Problem | edit-distance-cpp | ||||
| Optimal Binary Search Trees | |||||
| Egg Dropping Puzzle | egg-dropping-java | ||||
| Goldmine Problem | goldmine-java | ||||
| Longest Bitonic Subsequence | lbs-java | ||||
| Longest Common Subsequence | lcs-cpp | ||||
| Minimum Cuts for Palindrome Partitioning | mpc-java | ||||
| Maximum size square sub-matrix with all 1s | max-square-dp-java | ||||
| Subset Sum | subset-sum-dp-java | ||||
| Weighted Job Scheduling | weighted-job-sched-dp-cpp | ||||
| Minimum Cost Path | min-cost-path-cpp | ||||
| Minimum Steps to Reach 1 | min-steps-1-cpp |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Diameter of Tree | |||||
| Nodes at a distance k | k-far-java | ||||
| Lowest Common Ancestor | lca-java | ||||
| All root to leaf with sum of node values as k | root-to-leaf-k-java | ||||
| Check if binary tree is BST | is-bst-java | ||||
| Cousins of a node | cousin-nodes-java | ||||
| Top view of a binary tree | top-view-java | ||||
| Vertical view of a binary tree | vertical-view-java |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Fibonacci Sum | fib-sum-cpp | ||||
| Greatest Common Divisor | gcd-cpp | ||||
| nCr modulo Prime | ncr-mod-p-cpp | ||||
| Power function | power-cpp | ||||
| Sieve of Eratosthenes | sieve-cpp | ||||
| Fermat Primality Test | fermat-cpp | ||||
| Miller Rabin Primality Test | miller-rabin-cpp | ||||
| Range Query Problem | range-query-maths-java |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Breadth First Search | bfs-cpp | bfs-py | |||
| Depth First Search | dfs-cpp | dfs-py | |||
| Iterative deepening depth first search | iddfs-cpp | iddfs-py | |||
| Topological Sorting | top-sort-cpp | top-sort-py | |||
| Bipartite Graph Checking | bipartite-cpp | bipartite-py | |||
| Dijkstra's Algorithm | dijkstra-cpp | dijsktra-java | |||
| Bellman Ford's Algorithm | bellman-c | bellman-cpp | |||
| Floyd-Warshall-Algorithm | floyd-c | floyd-cpp | |||
| Johnson Algorithm | johnson-cpp | ||||
| Prim's Minimum Spanning Tree | prim-cpp | ||||
| Kruskal's Minimum Spanning Tree | kruskal-cpp | ||||
| Boruvka's Minimum Spanning Tree | boruvka-cpp | ||||
| Kosaraju's Strongly Connected Components | kosaraju-cpp | ||||
| Tarjan's Strongly Connected Components | tarjan-cpp | ||||
| Articulation Points | articulation-point-cpp | ||||
| Biconnected Graph Checking | biconnected-graph-cpp | ||||
| Biconnected Components | biconnected-comp-cpp | ||||
| Detect Cycle using Union Find | cycle-union-find-c |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Find all subsequences | subsequences-java | ||||
| Longest Repeated Subsequence | longest-repeated-subseq-java | ||||
| Edit Distance Problem | edit-distance-java | ||||
| Anagram Substring Search | |||||
| Longest Palindromic Substring | |||||
| Palindrome pair in an array of words (or strings) | |||||
| Lexicographically minimum string rotation |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Naive String Searching | naive-string-search-cpp | ||||
| Knuth-Morris-Pratt Algorithm | kmp-cpp | ||||
| Robin Karp Algorithm | robin-karp-cpp | ||||
| Boyer Moore Algorithm | |||||
| Z Algorithm | |||||
| Suffix Array |
| Title | c | cpp | java | python | blog post |
|---|---|---|---|---|---|
| Find orientation of 3 points | orientation-cpp | ||||
| Check if two lines segments intersect | line-seg-intersect-cpp | ||||
| Convex Hull Jarvis algorithm | convex-jarvis-cpp | ||||
| Convex Hull Graham Scan algorithm |
References:
- Introduction to Algorithms (CLRS) book
- CodeChef Discuss: List of DS Algo
- Programming Contest Detailed Syllabus
- CCDSAP Prepare
- Algorithms list GFG
- Competitive Programmer's Handbook by Antti Laaksonen
- Competitive Programming 3 by Steven Halim