Category: math
The problem is from codeforces: http://www.codeforces.com/problemset/problem/26/A The input range is small which means even the worst brute-force methods can pass the test. The straightforward implementation is . Defining a …
In mathematics, Newton method is an efficient iterative solution which progressively approaches better values. Its definition in is In numerical analysis, Newton’s method (also known as the Newton–Raphson method), …
One of the most selected algorithms in the last century is binary search. It is a general search method which is simple and efficient. It can be used to …
In , an unusual, fun sorting algorithm, called ‘Bogo’, is demonstrated using Python. This article, which introduces another famous sorting algorithm, which may be just for fun only. The …
A prime number is a positive natural number that is greater than 1 and no other divisors other than 1 and itself. For example, 2, 3, 5 are primes …