Rajat Jadam·May 18, 2020Time comparisons between two algorithms that evaluate the gcd of the two numbersIn this article let us study the time comparison of the two algorithms to evaluate the gcd of two numbers.
Rajat Jadam·Mar 31, 2020Find Maximum of a Function//You have to specify the range for which the function is Unimodal (sinx from 0 to PI) #include<iostream> #include<math.h> using namespace…
Rajat Jadam·Mar 30, 2020BFS and DFS in a Graph#include<iostream> #include<queue> #include<stack> #include<vector> using namespace std; int vertices; void…
Rajat Jadam·Feb 13, 2020Fibonacci Numbers using Simple Recursive technique#include<iostream> using namespace std; int fibonacci(int n){ if(n<=1){ return n; } return fibonacci(n-1)+fibonacci(n-2); } int…
Rajat Jadam·Feb 9, 2020Getting all prime numbers from 2 to some points of number(Sieve of Eratosthenes)We are interested in getting all the prime numbers from 2 to any number.
Rajat Jadam·Feb 9, 2020Program to find the square root of a number using Newton Raphson Method.#include<iostream> using namespace std; float absolute(float s){ if(s<0){ s=-s; } return s; } float sqrt(float n){ int…
Rajat Jadam·Feb 9, 2020Program to calculate the square root of a number using binary search approach.#include<iostream> using namespace std; int main() { float n; cout<<”Enter the value of N:”; cin>>n; float low=0; float high=n…
Rajat Jadam·Feb 9, 2020Program to print set of all divisors of a number.#include<iostream> #include<cmath> #include<vector> using namespace std; int main() { int a; cout<<”Enter the value of N:”; cin>>a…