ShivamSinghal1 / Competitive-Programming-Algorithms

The purpose of this repository is to get all the Algorithms required for Competitive Programming at one place. This will be very helpful. Also one can contribute to this repository and learn something from this.
https://codedigger.tech
21 stars 48 forks source link
algorithms algorithms-and-data-structures coding competitive-coding competitive-programming hacktoberfest

COMPETITIVE PROGRAMMING ALGORITHMS

The purpose of this repository is to get all the Algorithms required for Competitive Programming at one place. This will be very helpful.

If you wish to contribute, please refer to the contributor guidelines.

If you want to Practice then visit (https://codedigger.tech) and practice topicwise competitive problems from competitive sites Codeforces , SPOJ , Codechef and UVa.

Mathematics_Algo

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)

String_Algo

1) isVowel :- Check whether a character is vowel or not.

Array

1)Spiral search in 2d array