The purpose of this repository is to get all the Algorithms required for Competitive Programming at one place. This will be very helpful.
1) calculate_Factor :- To Calculate Factor of any number n, returns set loaded with all factors of n. 2) gcd_Extended :- To calculate gcd with Extended Euclidean ax+by=gcd(a,b). 3) isPrime :- To check whether a number is Prime or Not. 4) modInverse :- To calculate modInverse of any number, (a * modInverse of a)% m = 1. 5) nCr with Mod :- Returns (nCr)%m. 6) nCr without Mod :- Return (nCr). 7) power with Mod :- (n^p)%m. 8) power without Mod :- (x^y). 9) pre_calculate_factorial :- To pre calculate factorial and there inverse and loaded in the array. 10) prime_factor :- Generate prime factors of any number n. 11) seive :- Return vector with loaded prime numbers. Fill array with smallest prime factor that divides that number. Example:- for a[1] = 0, a[2] or for prime number = 1, for composite a[6] = 2. 12) sum of GP :- Calculate sum of Geometric Progression of series (1 + r + r^2 +....+ r^(n-2) ) % m. 13) totient :- Total numbers from 1 to N whose gcd with N is 1. 14) fibonacciNumber(n) :- Returns the nth Fibonacci Number in constant time. 15)Spiral Search in 2d array (C++ code)
1) isVowel :- Check whether a character is vowel or not.
1)Spiral search in 2d array