Linear
Non-Linear
Sort
Search
Tree Traversal
Graph
Dynamic Programming
Recursive algorithms provide a powerful framework for solving problems by breaking them down into smaller, self-similar subproblems. By focusing on the decomposition process and understanding how to express solutions recursively, you'll gain a deeper understanding of algorithmic design principles that can be applied to a wide range of problems.
A backtracking algorithm tries to construct a solution to a computational problem incrementally, one small piece at a time. Whenever the algorithm needs to decide between multiple alternatives to the next component of the solution, it recursively evaluates every alternative and then chooses the best one.
Sorting algorithms move elements in a list into a specific order. They work by comparing elements to determine their order, and then moving them into a new order.
Search algorithms work by analyzing a user's query and finding the most relevant results.
An array algorithm works by utilizing the structure of an array to efficiently access and manipulate data using indices.
Most matrix algorithms use nested loops to iterate through the rows and columns of the matrices, performing the necessary calculations for each element of the resulting matrix
A graph algorithm works by traversing the nodes and edges of a graph, following the connections between them to solve a specific problem, like finding the shortest path between two nodes, identifying connected components, or detecting cycles, by exploring the graph step-by-step based on a set of rules, often using techniques like Depth-First Search (DFS) or Breadth-First Search (BFS) to visit each node in a structured order.
A "number algorithm" generally performs mathematical operations on numbers. The core of a number algorithm involves basic mathematical operations like addition, subtraction, multiplication, and division, often combined in complex ways depending on the problem.
A string algorithm, also called a string matching algorithm, generally searching for occurrences of a "pattern" within a "text" by comparing characters at each position and shifting the pattern along the text until a match is found.
Recursive algorithms, while conceptually elegant, can be computationally expensive due to overlapping subproblems. Dynamic Programming techniques, encompassing memoization and tabulation, mitigate this inefficiency by storing the solutions to these subproblems. This allows for efficient retrieval and reuse of previously computed results, leading to a substantial improvement in the algorithm's overall time complexity.
Find Nth Fibonacci number
[Memoization] [Tabulation]
Find Nth Tribonacci number
[Memoization] [Tabulation]
Find Binomial coefficient
[Memoization] [Tabulation]
Find Nth Catalan Number
[Memoization] [Tabulation]
Find all subsequence combinations of a string
[Memoization] [Tabulation]
Pascal's Triangle
[Memoization] [Tabulation]
Find all distinct subset sums of an array
[Memoization] [Tabulation]
Number of unique BST with N keys
[Memoization] [Tabulation]
Count number of derangements
[Memoization] [Tabulation]
Find number of permutation with K inversions
[Memoization] [Tabulation]
Find number of ways paint a fence with n posts and k colors
[Memoization] [Tabulation]
Print maximum number of A’s using given four keys
[Memoization] [Tabulation]
Climbing stairs
[Memoization] [Tabulation]
Climbing stairs with 3 moves
[Memoization] [Tabulation]
Maximize number segments of cutted in length x, y and z
[Memoization] [Tabulation]
Arrange balls
[Memoization] [Tabulation]
Stacking box
[Memoization] [Tabulation]
Find minimum of jumps to reach end
[Memoization] [Tabulation]
Weighted interval job scheduling
[Memoization] [Tabulation]
Unbounded knapsack
[Memoization] [Tabulation]
0/1 Knapsack problem
[Memoization] [Tabulation]
Find number of way to make coin change
[Memoization] [Tabulation]
Find minimum coins to make change
[Memoization] [Tabulation]
Subset sum
[Memoization] [Tabulation]
Partition a set into two subsets of equal sum
[Memoization] [Tabulation]
Maximize total tips
[Memoization] [Tabulation]
House robber
[Memoization] [Tabulation]
Find longest increasing subsequence (LIS)
[Memoization] [Tabulation]
Subsequence with difference of 1
[Memoization] [Tabulation]
Longest palindromic subsequence (LPS)
[Memoization] [Tabulation]
Minimum insertions to form a palindrome
[Memoization] [Tabulation]
Find the minimum number of edits
[Memoization] [Tabulation]
Find longest common substring
[Memoization] [Tabulation]
Find longest common subsequence (LCS)
[Memoization] [Tabulation]
Longest common increasing subsequence (LCS + LIS)
[Memoization] [Tabulation]
Word break
[Memoization] [Tabulation]
Count unique paths in matrix from top left to bottom right
[Memoization] [Tabulation]
Min cost path
[Memoization] [Tabulation]
Maximum size of square sub-matrix with all 1s
[Memoization] [Tabulation]
Regular expression wildcard pattern matching
[Memoization] [Tabulation]
A greedy algorithm is a problem-solving technique that chooses the best option at each step, with the goal of finding a globally optimal solution. Greedy algorithms are simple and easy to implement, but they don't always produce the best solution.