# Tag Archives: math

## Program to calculate area of an Circle inscribed in a Square

Given the side of a square. The task is to find the area of an inscribed circle in a square. Examples: Input : a =… Read More »

## Find (a^b)%m where ‘b’ is very large

Given three numbers a, b and m where 1<=a, m<=10^6. Given very large 'b' containing up to 10^6 digits and m is a prime number,… Read More »

## Minimum operations required to make all the elements distinct in an array

Given an array of N integers. If a number occurs more than once, choose any number y from the array and replace the x in… Read More »

## Find i’th index character in a binary string obtained after n iterations | Set 2

Given a decimal number m, convert it into a binary string and apply n iterations, in each iteration 0 becomes “01” and 1 becomes “10”.… Read More »

## Number of rectangles in a circle of radius R

Given a circular sheet of radius R and the task is to find the total number of rectangles with integral length and width that can… Read More »

## Reorder the given string to form a K-concatenated string

Given a string S and an integer K. The task is to form a string T such that the string T is a reordering of… Read More »

## Minimum number of operations to convert a given sequence into a Geometric Progression

Given a sequence of N elements, only three operations can be performed on any element at most one time. The operations are: Add one to… Read More »

## Program to find the Area of an Ellipse

Given an ellipse with a semi-major axis of length a and semi-minor axis of length b. The task is to find the area of an… Read More »

## std::hermite in C++

std::hermite is based on the hermite polynomial function given by: After solving the Hermite’s Polynomial, the results come out to be like the following table:… Read More »

## Design a stack to retrieve original elements and return the minimum element in O(1) time and O(1) space

Our task is to design a Data Structure SpecialStack that supports all the stack operations like push(), pop(), isEmpty(), isFull() and an additional operation getMin()… Read More »

## Find sum of all nodes of the given perfect binary tree

Given a positive integer L which represents the number of levels in a perfect binary tree. Given that the leaf nodes in this perfect binary… Read More »