×
Home Discussions Write at Opengenus IQ
×
  • Join our Internship πŸŽ“
  • #7daysOfCode
  • C Interview questions
  • Linux πŸ’½
  • πŸ”Š Data Structures
  • Graph Algorithms
  • Dynamic Programming πŸ’‘
  • Greedy Algo πŸ“”
  • Algo Book 🧠
  • String Algo 🧬
  • Home

List of Mathematical Algorithms

This is the ultimate list of Mathematical Algorithms. These are algorithms that utilize insightful mathematical ideas at its core.

Algorithms

Counting derangements

Given any integer N, we need to find out the number of Derangements for a set of N elements.

Amruta U. Koshe
Algorithms

What is a Disarium Number?

A disarium number is a number in which the sum of the digits to the power of their respective position is equal to the number itself (position is counted from left to right starting from 1).

Shubham Sood Shubham Sood
Algorithms

Minimum steps to make binary string empty by removing alternating subsequence in each step

Given a string str consisting of only '0's and '1's, the task is to make the string empty by performing minimum number of operations. An operation is defined as the removal of an alternating subsequence from str without changing the order of the remaining characters.

Aditya Kumar Saroj
Algorithms

Minimum elements to be removed from array to make the sum even

Given an array of integer and you have to find minimum no of integers or elements from array need to be removed so that sum of all elements of array results an even value.

Aayushi Ghadiya
Algorithms

Find number of solutions of a linear equation of N variables

We have to find the number of solutions to a linear equation of N variables. We have solved this using Dynamic Programming.

Shrey Tripathi
Algorithms

Algorithms for Calculating Day of Week

Some of the Algorithms for Calculating Day of Week are: Tomohiko Sakamoto Algorithm, Gausses Algorithm and Wang's Algorithm. We have covered the basics of Julian and Georgian calender as well.

Anjali Chaturvedi Anjali Chaturvedi
Software Engineering

SHA1 Algorithm (+ JavaScript Implementation)

In this article, we have explained the algorithmic steps in SHA1 Algorithm in depth. We have demonstrated an example by implementing SHA1 algorithm in JavaScript.

Mohammed Ajmal Siddiqui
Algorithms

Minimum number of increment operations to make K elements of an array equal

Given an array arr[] of n elements and an integer k, the task is to make any k elements of the array equal by performing only increment operations. This is solved using sliding window technique.

Aarushi Ghadiya
Algorithms

Tomohiko Sakamoto Algorithm

Tomohiko Sakamoto Algorithm is used to find the Day of the week for a given date. The date is provided according to the Gregorian Calendar.

Ishaan Ahuja
Algorithms

Minimum number of operations to make XOR of array equal to zero

You are given an array of n non-negative integers. Your task is to find the minimum number of operations to make XOR of array equal to zero.

Raghav Somani
Algorithms

Carmichael Number

Carmichael Number is an odd composite number which follows the following condition applicable in Fermat's Little Theorem.

Piyush Rajendra Chaudhari Piyush Rajendra Chaudhari
Algorithms

Minimum Bitwise OR operations to make any two array elements equal

Given an array of integers and an integer K, we can perform the Bitwise OR operation between K and elements of the array any number of times. We have to count minimum number of such operations that are required to make any two elements of the array equal.

Ishaan Ahuja
Algorithms

Gale Shapley Algorithm for Stable Matching problem

Gale Shapley Algorithm is an efficient algorithm that is used to solve the Stable Matching problem. It takes O(N^2) time complexity where N is the number of people involved.

Tushti
Algorithms

Minimum Increment and Decrement operations to make array elements equal

We are given an array, we need to find the minimum number of increment and decrement operations (by 1) required to make all the array elements equal. We have explored two approaches where brute force approach take O(N^2) time while the efficient approach O(N logN) time.

Tushti
Algorithms

Minimum number of increment (by 1) operations to make elements of an array unique

We are given a sorted array which might have duplicate elements, our task is to find the minimum number of increment (by 1) operations needed to make the elements of an array unique. We have solved this using two approaches one using two pointers and other using hashmap.

Tushti
Algorithms

Applications of Catalan Numbers

In this article, we have explored different applications of Catalan Numbers such as number of valid parenthesis expressions, number of rooted binary trees with n internal nodes, number of ways are there to cut an (n+2)-gon into n triangles and many more.

Khushi Priya
Algorithms

Algorithm to find the maximum power of N that divides M factorial (M!)

We are given two numbers M and N. Our aim is to find the highest power of N that divides Factorial of M (M!). First we have discussed about the Brute Force approach and then we will be discussing this problem using Legendre’s formula.

Shivani Rajput Shivani Rajput
Algorithms

Kadane's Algorithm for largest subarray sum

Kadane's Algorithm is commonly known for Finding the largest sum of a subarray in linear time O(N). We have presented 3 variants of Kadane's Algorithm along with in-depth explanation of basic ideas.

Raksha Jain
Algorithms

Binary GCD Algorithm

Binary GCD algorithm or Stein's algorithm is an algorithm that calculates two non-negative integer's largest common divisor by using simpler arithmetic operations than the standard euclidean algorithm and it reinstates division by numerical shifts, comparisons, and subtraction operations.

Simrann Arora Simrann Arora
Algorithms

Minimum number of operations to make GCD of an array K

We are given an array and we need to find the minimum number of operations required to make GCD of the array equal to k. Where an operation could be either increment or decrement an array element by 1. We have solved this in O(N log N) time complexity.

Shweta Bhardwaj
Algorithms

Minimum number of increment (by 1) operations to make array in increasing order

Given an array of size N . Find the number of increment (by 1) operations required to make the array in increasing order. In each move, we can add 1 to any element in the array.

Sweta Behera
Algorithms

Find Maximum Perimeter of a Triangle

Given an array of integers, find which three elements form a non-degenerate triangle such that the triangle has maximum perimeter. This can be done using a Greedy algorithm by sorting the array of integers.

Nikita Masand Nikita Masand
Algorithms

Make N numbers equal by incrementing N-1 numbers

Given an array, find the minimum number of operations to make all the array elements equal. The operation includes incrementing all but one element of the array by 1.

Nikita Masand Nikita Masand
Algorithms

Finding all Armstrong Numbers in a given range

In this article, we will develop an approach to find all armstrong numbers in a given range. The approach is to check for each number in the range if it is an armstrong number or not.

SRISTI DAKSHIT
Algorithms

Split a number into K unique parts such that their GCD is maximum

The problem is to split a number N into K unique parts such that the sum of the parts is equal to N and the greatest common divisor of the K parts is maximum. This can be solved in O(N^1/2) time complexity using a greedy approach.

Sushil Sarwade
×

Visit our discussion forum to ask any question and join our community

View Forum
OpenGenus IQ © 2021 All rights reserved β„’ [email: team@opengenus.org]
Top Posts LinkedIn Twitter