Bellman Ford
What is Bellman Ford The Bellman Ford algorithm is the algorithm that solving the single source shortest path questions. It also solve the problem that the Dijkstra can not deal with the graph wit...
What is Bellman Ford The Bellman Ford algorithm is the algorithm that solving the single source shortest path questions. It also solve the problem that the Dijkstra can not deal with the graph wit...
What is Dijkstra Dijkstra is used to solve the single source shortest path question, which based on the greedy algorithm. The core idea is similar to the Prim algorithm. The difference between it...
What is Binary Exponentiation If we use pow() to compute $2^{13}$, the time complexity is not equal to $O(logn)$(look up the c++ document), and using simple loop is too slow. So the Binary Exponen...
What is Disjoint_Set Union(DSU)? The DSU is a data struct that keeps track of collection of disjoint set and provides two functions: find: find which set an element x belongs to and retur...
What is MST? Given an undirected, connected, weighted graph, an MST is a subset of edges that: connect all vertices has no cycles and the minimum possible total edge weight MST Algorithm...
DFS() and BFS() are two basic searching methods in graph. They are the foundation of many algorithms. What is DFS? We will use tree to understand DFS better, and it’s same as other graph actually...
Adjacency List There are two ways to achieve the Adjacency List: use vector or use linked list. Because the vector is automatic RAII container, it don’t need to release the memory. But using linke...
What is Sieve In number theory, there are always some requests getting some special numbers, such as prime. The Sieve is the algorithm getting these numbers and the Euler Sieve is to get prime in ...
What is Master Theorem? Master Theorem is an important tools to analyze the time complexity of divide-and-conquer algorithm, which form is: \(T(n) = aT\left(\frac{n}{b}\right) + f(n)\) Symbol: ...
KMP Algorithm What’s the function of KMP? When we have a text and a string, we want to know whether the string is in it or not, if it is in the text, how many times it appeared? If we use the nai...