
Recursion | Brilliant Math & Science Wiki
For recursion in computer science, see recursive functions. Recursion formalizes the process of recognizing how solutions to smaller cases of a problem can, layer by layer, be built up to …
Backpack Problem | Brilliant Math & Science Wiki
The backpack problem (also known as the "Knapsack problem") is a widely known combinatorial optimization problem in computer science. In this wiki, you will learn how to …
Merge Sort | Brilliant Math & Science Wiki
Merge sort (sometimes spelled mergesort) is an efficient sorting algorithm that uses a divide-and-conquer approach to order elements in an array. Sorting is a key tool for many problems in …
Recurrence Relations | Brilliant Math & Science Wiki
A recurrence relation is an equation that uses recursion to relate terms in a sequence or elements in an array. It is a way to define a sequence or array in terms of itself. Recurrence relations …
The Substitution Method for Solving Recurrences - Brilliant
The substitution method for solving recurrences is famously described using two steps: Guess the form of the solution. Use induction to show that the guess is valid. This method is especially …
Recursive Backtracking | Brilliant Math & Science Wiki
Backtracking can be thought of as a selective tree/graph traversal method. The tree is a way of representing some initial starting position (the parent node) and a final goal state (one of the …
Depth-First Search (DFS) | Brilliant Math & Science Wiki
Depth-first search (DFS) is an algorithm for searching a graph or tree data structure. The algorithm starts at the root (top) node of a tree and goes as far as it can down a given branch …
Master Theorem | Brilliant Math & Science Wiki
The master theorem provides a solution to recurrence relations of the form T (n) = a T (n b) + f (n), T (n) = aT (bn)+f (n), for constants a ≥ 1 a ≥ 1 and b> 1 b> 1 with f f asymptotically positive. …
Stacks | Brilliant Math & Science Wiki
A stack is an abstract data type that places restrictions on where you can add and remove elements. A good analogy is to think of a stack as a stack of books; you can remove only the …
Dynamic Programming | Brilliant Math & Science Wiki
Dynamic programming refers to a problem-solving approach, in which we precompute and store simpler, similar subproblems, in order to build up the solution to a complex problem. It is …