Skip to main content
Graph

MikeLess than 1 minuteleetcodegraph
Other

MikeLess than 1 minuteleetcodeother
Dynamic Programming

Dynamic Programming

What is Dynamic Programming (DP)?

Dynamic Programming (DP) is a method used in mathematics and computer science to solve complex problems by breaking them down into simpler subproblems. By solving each subproblem only once and storing the results, it avoids redundant computations, leading to more efficient solutions for a wide range of problems.


MikeAbout 2 minleetcodedynamic programming
Greedy

Greedy

Greedy algorithms are a class of algorithms that make locally optimal choices at each step with the hope of finding a global optimum solution. In these algorithms, decisions are made based on the information available at the current moment without considering the consequences of these decisions in the future. The key idea is to select the best possible choice at each step, leading to a solution that may not always be the most optimal but is often good enough for many problems.


MikeLess than 1 minuteleetcodegreedy
Backtracking

Backtracking

Backtracking is an algorithmic technique for solving problems recursively by trying to build a solution incrementally, one piece at a time, removing those solutions that fail to satisfy the constraints of the problem at any point of time (by time, here, is referred to the time elapsed till reaching any level of the search tree).


MikeLess than 1 minuteleetcodebacktracking
Binary Tree

Binary Tree

Definition

In computer science, a binary tree is a tree data structure in which each node has at most two children, referred to as the left child and the right child. That is, it is a k-ary tree with k = 2. A recursive definition using set theory is that a binary tree is a tuple (L, S, R), where L and R are binary trees or the empty set and S is a singleton set containing the root.


MikeAbout 6 minleetcodebinary tree
Stack/Queue

Stack/Queue

Stack

In computer science, a stack is an abstract data type that serves as a collection of elements with two main operations:

  • Push, which adds an element to the collection, and
  • Pop, which removes the most recently added element.


MikeAbout 2 minleetcodestackqueue
Two Pointers

Two Pointers

The two pointers technique is a technique used to iterate through a data set, typically an array or a list, in a controlled way. It involves using two pointers, one pointing to the beginning of the data set and the other pointing to the end, and moving them towards each other based on specific conditions. This technique is commonly used to solve problems that involve searching for a specific condition or pattern within a data set, or that require a comparison between different elements in the data set.


MikeAbout 1 minleetcodetwo pointers
String

String


In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable.

Exercise

Reverse String

344: Reverse String
541: Reverse String II


MikeLess than 1 minuteleetcodestring
2