Category: algorithms
In , the GCD (Greatest Common Divisor) is given in brief details. The algorithm can be implemented in both recursive and iterative forms. The recursive formula is , and …
Quick Sort is a comparison sorting method, on average, the complexity is . In worst cases, e.g. when the array of elements are already sorted, it is degraded into …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/245/B It is an easy string-matching related problem. You can have many ways to solve this. Because of the limitation, i.e. the first letter must …
In , two equations are used and compare the efficiency of computation of the math constant . The following are some commonly-used equations to compute the We pick the …
Disjoint Sets is one of the most powerful and yet simple data structure. The idea of Disjoint Sets can be perfectly applied in finding the minimal spanning tree. The …