Tag: tutorial
Fermat Prime Test Algorithm is to check whether a number is prime. It is a probabilistic approach that based on the following observation. . This is also known as …
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 …
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 …
In , the basic 0/1 knapsack is discussed. For each item, you can choose to put or not to put into the knapsack. Therefore, for the number of items, …