Time 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.May 18, 2020May 18, 2020
Find 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…Mar 31, 2020Mar 31, 2020
BFS and DFS in a Graph#include<iostream> #include<queue> #include<stack> #include<vector> using namespace std; int vertices; void…Mar 30, 2020Mar 30, 2020
Fibonacci 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…Feb 13, 2020Feb 13, 2020
Getting 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.Feb 9, 2020Feb 9, 2020
Program 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…Feb 9, 2020Feb 9, 2020
Program 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…Feb 9, 2020Feb 9, 2020
Program 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…Feb 9, 2020Feb 9, 2020