DSA CheatSheet by JB - Sheet1
DSA CheatSheet by JB - Sheet1
Number Theory
1. Prime Numbers
Py3 Number_Theory/Primilarity_Test/PRB01.py
Primilarity Test https://www.codechef.com/practice/course/logical-problems/DIFF800/problems/PRB01
Class C++ Number_Theory/Primilarity_Test/PRB01.cpp
https://www.spoj.com/problems/TDKPRIME/
Class C++ Number_Theory/Sieve_Of_Eratosthenes/TDKPRIME.cpp
Sieve of Eratosthenes
https://leetcode.com/problems/count-primes
HW Py3 Number_Theory/Sieve_Of_Eratosthenes/Count_primes.py
https://www.spoj.com/problems/PFACT/
HW C++ Number_Theory/Prime_Factors/PFACT.cpp
https://codeforces.com/problemset/problem/17/A
Class Py3 Number_Theory/Prime_Factors/Noldbach.py
Prime factors https://codeforces.com/problemset/problem/26/A
HW C++ Number_Theory/Prime_Factors/Almost_Prime.cpp
Segmented Seivehttps://www.spoj.com/problems/PRIME1/
Class C++ Number_Theory/Segmented_Seive/PRIME1.cpp
4. Binary Exponentiation
C++ Number_Theory/Binary_Exponentiation/Powxn.cpp
https://leetcode.com/problems/powx-n
Class Py3 Number_Theory/Binary_Exponentiation/Powxn.py
https://leetcode.com/problems/count-good-numbers
HW C++ Number_Theory/Binary_Exponentiation/Cout_Good_Numbers.cpp
C++ Number_Theory/Binary_Exponentiation/Climbing_Stairs.cpp
https://leetcode.com/problems/climbing-stairs
Class Py3 Number_Theory/Binary_Exponentiation/Climbing_Stairs.py
https://leetcode.com/problems/student-attendance-record-ii
HW C++ Number_Theory/Binary_Exponentiation/Attendance_Record_2.cpp
Binary Exponentiation
https://codeforces.com/gym/102644
HW - Codeforces Gym for fast Exponentiation (9 problems)
5. Combinatorics
https://codeforces.com/contest/1279/problem/D
HW
https://codeforces.com/contest/300/problem/C
HW
https://leetcode.com/problems/count-anagrams/
Class Py3 Number_Theory/Combinatorics/Count_Anagrams.py
https://codeforces.com/contest/717/problem/A
HW
Combinatorics https://codeforces.com/contest/1992/problem/G
HW
7. String Basics
https://leetcode.com/problems/longest-common-prefix
HW Py3 Arrays_Strings_Linked_Lists/String_Basics/Longest_Common_Prefix.py
https://leetcode.com/problems/check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
HW Py3 Arrays_Strings_Linked_Lists/String_Basics/Is_Prefix_In_Sentence.py
Basics https://leetcode.com/problems/count-prefix-and-suffix-pairs-i
HW
C++ Arrays_Strings_Linked_Lists/Strings_Sliding_Window/Index_Of_First_Occurence.cpp
https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string
Class Py3 Arrays_Strings_Linked_Lists/Strings_Sliding_Window/Index_Of_First_Occurence.py
https://leetcode.com/problems/rotate-string
Class Py3 Arrays_Strings_Linked_Lists/Strings_Sliding_Window/Rotate_String.py
Sliding Window
Sliding Window https://leetcode.com/problems/string-matching-in-an-array
HW Py3 Arrays_Strings_Linked_Lists/Strings_Sliding_Window/String_Matching_In_Array.py
8. String Hashing
https://leetcode.com/problems/string-matching-in-an-array
HW
Polynomial Hashing
https://leetcode.com/problems/rotate-string
HW
https://acmp.ru/asp/do/index.asp?main=task&id_course=2&id_section=18&id_topic=42&id_problem=262
Class C++ Arrays_Strings_Linked_Lists/Rabin_Karp_Algorithm/Substring_Search_Rabin_Karp.cpp
https://www.spoj.com/problems/NAJPF/
HW
Rabin-Karp Algorithm
https://codeforces.com/problemset/problem/271/D
HW
14. Queues
https://leetcode.com/problems/implement-queue-using-stacks/
Class C++ Stacks_Queues_PQ_Heaps/Queues/Queue_Using_Stacks.cpp
https://leetcode.com/problems/implement-stack-using-queues/
HW
https://leetcode.com/problems/first-unique-character-in-a-string/
Class Py3 Stacks_Queues_PQ_Heaps/Queues/First_Unique_Character_String.py
https://www.geeksforgeeks.org/problems/reverse-first-k-elements-of-queue/1
HW
https://www.geeksforgeeks.org/problems/restricted-pacman--141631/1
HW
Queues https://leetcode.com/problems/lru-cache/
HW
https://www.geeksforgeeks.org/problems/first-negative-integer-in-every-window-of-size-k3345/1
Class C++ Stacks_Queues_PQ_Heaps/Deque/First_Negative_In_Every_Window_Size_K.cpp
https://www.geeksforgeeks.org/problems/ipl-2021-match-day-2--141634/1
HW
Deque https://leetcode.com/problems/design-circular-deque/
HW
17. Graphs
Class C++ Trees_and_Graphs/Graph_Representation/Print_Adjacency_List.cpp
Graph Representation
https://www.geeksforgeeks.org/problems/print-adjacency-list-1587115620/1
Class Py3 Trees_and_Graphs/Graph_Representation/Print_Adjacency_List.py
https://www.geeksforgeeks.org/problems/depth-first-traversal-for-a-graph/1
HW
https://www.geeksforgeeks.org/problems/bfs-traversal-of-graph/1
Class C++ Trees_and_Graphs/Graph_Traversal/BFS_Of_Graph.cpp
https://leetcode.com/problems/number-of-provinces/
HW
https://leetcode.com/problems/count-the-number-of-complete-components/
HW
https://www.geeksforgeeks.org/problems/depth-first-traversal-for-a-graph/1
Class C++ Trees_and_Graphs/Graph_Traversal/DFS_Of_Graph.cpp
https://leetcode.com/problems/course-schedule-ii/
HW
http://codeforces.com/contest/734/problem/E
HW
https://leetcode.com/problems/flood-fill/
Class Py3 Trees_and_Graphs/Graph_Traversal/Flood_Fill.py
http://codeforces.com/contest/813/problem/C
HW
https://leetcode.com/problems/word-ladder-ii/
HW
Graph Traversal https://www.spoj.com/problems/INVESORT/
HW
Class C++ Trees_and_Graphs/Disjoint_Sets/Union_Find_By_Rank.cpp
https://www.geeksforgeeks.org/problems/union-find/1
HW (Union by size)
https://leetcode.com/problems/redundant-connection/
Class Py3 Trees_and_Graphs/Disjoint_Sets/Redundant_Connection.py
https://www.geeksforgeeks.org/problems/detect-cycle-in-an-undirected-graph/1
HW
https://www.geeksforgeeks.org/problems/minimum-spanning-tree/1
Class C++ Trees_and_Graphs/Disjoint_Sets/Minimum_Spanning_Tree_Kruskals.cpp
https://leetcode.com/problems/number-of-islands/
HW
Disjoint Sets https://leetcode.com/problems/groups-of-strings/
HW
https://www.geeksforgeeks.org/problems/minimum-spanning-tree/1
Class C++ Trees_and_Graphs/Minimum_Spanning_Trees/Minimum_Spanning_Tree_Prims.cpp
https://leetcode.com/problems/min-cost-to-connect-all-points/
HW
https://codeforces.com/contest/1245/problem/D
Class C++ Trees_and_Graphs/Minimum_Spanning_Trees/Shichikuji_And_Power_Grid.cpp
https://www.hackerearth.com/practice/algorithms/graphs/minimum-spanning-tree/practice-problems/algorithm/complete-journey-bf38d697/
HW
https://www.hackerearth.com/practice/algorithms/graphs/minimum-spanning-tree/practice-problems/algorithm/grid-of-many-xors-de84b766/
HW
Minimum Spanning
https://leetcode.com/problems/find-critical-and-pseudo-critical-edges-in-minimum-spanning-tree/
Trees HW
C++ Trees_and_Graphs/Topological_Sorting/Topological_Sort_DFS.cpp
https://www.geeksforgeeks.org/problems/topological-sort/1
Class Py3 Trees_and_Graphs/Topological_Sorting/Topological_Sort_Kahns.py
https://codeforces.com/problemset/problem/510/C
HW
https://leetcode.com/problems/course-schedule/
HW
https://leetcode.com/problems/course-schedule-ii/
HW
https://www.hackerrank.com/contests/101hack40/challenges/next-topological-sorting
HW
Topological Sorting
https://cses.fi/problemset/task/1681
HW
https://www.geeksforgeeks.org/problems/shortest-path-in-undirected-graph-having-unit-distance/1
Class C++ Trees_and_Graphs/Shortest_Path/Undirected_Unweighted_Graph_BFS.cpp
https://www.geeksforgeeks.org/problems/shortest-path-in-undirected-graph/1
HW
https://www.geeksforgeeks.org/problems/shortest-path-in-weighted-undirected-graph/1?utm_source=youtube&utm_medium=collab_striver_ytdescription&utm_campaign=shorte
HW
https://codeforces.com/contest/20/problem/C
HW
https://www.geeksforgeeks.org/problems/implementing-dijkstra-set-1-adjacency-matrix/1
Class C++ Trees_and_Graphs/Shortest_Path/Weighted_Graph_Dijkstra.cpp
https://leetcode.com/problems/evaluate-division/
HW
https://leetcode.com/problems/network-delay-time/
HW
https://leetcode.com/problems/cheapest-flights-within-k-stops/
HW
https://www.geeksforgeeks.org/problems/distance-from-the-source-bellman-ford-algorithm/1
Class Py3 Trees_and_Graphs/Shortest_Path/Bellman_Ford.py
https://leetcode.com/problems/design-graph-with-shortest-path-calculator/
HW
https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/
HW
https://leetcode.com/problems/number-of-ways-to-arrive-at-destination/
Class Py3 Trees_and_Graphs/Shortest_Path/Number_Ways_Arrive_At_Destination.py
Shortest Path https://codeforces.com/problemset/problem/141/D
HW
Dynamic Programming
18. DP on Arrays & Matrices
https://leetcode.com/problems/fibonacci-number/
HW
Py3 Dynamic_Programming/Standard_Array_Matrix_DP/Longest_Increasing_Subssequence.py
https://leetcode.com/problems/longest-increasing-subsequence/
Class C++ Dynamic_Programming/Standard_Array_Matrix_DP/Longest_Increasing_Subssequence.cpp
https://leetcode.com/problems/minimum-cost-to-cut-a-stick/
HW
https://www.geeksforgeeks.org/problems/0-1-knapsack-problem0945/1
HW
https://www.geeksforgeeks.org/problems/subset-sum-problem-1611555638/1
HW
https://www.hackerrank.com/challenges/coin-change/problem
Class Py3 Dynamic_Programming/Standard_Array_Matrix_DP/Coin_Change_Problem.py
Standard Array & https://www.geeksforgeeks.org/problems/matrix-chain-multiplication0303/1
Matrix DP Problems
HW
https://leetcode.com/problems/climbing-stairs/
HW
https://leetcode.com/problems/coin-change
HW
https://www.geeksforgeeks.org/problems/minimal-cost/1
Class C++ Dynamic_Programming/Array_DP/Minimal_Cost.cpp
https://www.hackerrank.com/challenges/two-robots/
HW
C++ Dynamic_Programming/Array_DP/House_Robber.cpp
https://leetcode.com/problems/house-robber/
Class
Array DP
https://leetcode.com/problems/house-robber/
Class Py3 Dynamic_Programming/Array_DP/House_Robber.py
https://leetcode.com/problems/house-robber-ii/
HW
Array DP https://codeforces.com/problemset/problem/1061/C
HW
https://leetcode.com/problems/unique-paths/
HW
https://leetcode.com/problems/unique-paths-ii/
Class C++ Dynamic_Programming/Matrix_DP/Unique_Paths_II.cpp
https://leetcode.com/problems/minimum-path-sum/
HW
https://leetcode.com/problems/minimum-falling-path-sum
HW
https://www.geeksforgeeks.org/problems/chocolates-pickup/1
Class C++ Dynamic_Programming/Matrix_DP/Chocolates_Pickup.cpp
https://www.hackerrank.com/challenges/queens-on-board/
HW
Matrix DP https://www.hackerrank.com/challenges/matrix-land/
HW
19. DP on Strings
https://leetcode.com/problems/longest-common-subsequence/
HW
https://www.geeksforgeeks.org/problems/print-all-lcs-sequences3413/1
HW
https://leetcode.com/problems/edit-distance/
HW
Standard String DP
https://www.geeksforgeeks.org/problems/palindromic-patitioning4845/1
Problems Class Py3 Dynamic_Programming/Standard_String_DP/Palindromic_Partitioning.cpp
https://www.geeksforgeeks.org/problems/longest-common-substring1452/1
HW
https://leetcode.com/problems/minimum-insertion-steps-to-make-a-string-palindrome/
HW
Class Py3 Dynamic_Programming/String_DP/Sam_And_Substrings.py
https://www.hackerrank.com/challenges/sam-and-substrings/
Class C++ Dynamic_Programming/String_DP/Sam_And_Substrings.cpp
https://codeforces.com/problemset/problem/766/C
HW
https://leetcode.com/problems/distinct-subsequences/
HW
https://leetcode.com/problems/shortest-common-supersequence/
Class C++ Dynamic_Programming/String_DP/Shortest_Common_Supersequence.cpp
https://www.hackerrank.com/challenges/alien-languages/
HW
https://leetcode.com/problems/wildcard-matching/
Class C++ Dynamic_Programming/String_DP/Wildcard_Matching.cpp
https://atcoder.jp/contests/abc122/tasks/abc122_d
HW
String DP https://codeforces.com/problemset/problem/977/F
HW