## Sudo Placement | Range Queries

Given Q queries, with each query consisting of two integers L and R, the task is to find the total numbers between L and R… Read More »

## Smallest number with given sum of digits and sum of square of digits

Given sum of digits and sum of square of digits . Find the smallest number with given sum of digits and sum of the square… Read More »

## Advanced master theorem for divide and conquer recurrences

Master Theorem is used to determine running time of algorithms (divide and conquer algorithms) in terms of asymptotic notations. Consider a problem that be solved… Read More »

## Distinct elements in subarray using Mo’s Algorithm

Given an array ‘a[]’ of size n and number of queries q. Each query can be represented by two integers l and r. Your task… Read More »

## Binary Search on Singly Linked List

Given a singly linked list and a key, find key using binary search approach. To perform a Binary search based on Divide and Conquer Algorithm,… Read More »

## Decrease and Conquer

As divide-and-conquer approach is already discussed, which include following steps: Divide the problem into a number of subproblems that are smaller instances of the same… Read More »

Binary search is a popular method of searching in a sorted array or list. It simply divides the list into two halves and discard the… Read More »

## Numbers whose factorials end with n zeros

Given an integer n, we need to find the number of positive integers whose factorial ends with n zeros. Examples: Input : n = 1… Read More »

## Iterative Fast Fourier Transformation for polynomial multiplication

Given two polynomials, A(x) and B(x), find the product C(x) = A(x)*B(x). In the previous post we discussed the recursive approach to solve this problem… Read More »

## Fast Fourier Transformation for poynomial multiplication

Given two polynomial A(x) and B(x), find the product C(x) = A(x)*B(x). There is already an O() naive approach to solve this problem. here. This… Read More »

## The painter’s partition problem | Set 2

We have to paint n boards of length {A1, A2, .. An}. There are k painters available and each takes 1 unit time to paint… Read More »

## Find closest number in array

Given an array of sorted integers. We need to find the closest value to the given number. Array may contain duplicate values and negative numbers.… Read More »

## The painter’s partition problem

We have to paint n boards of length {A1, A2…An}. There are k painters available and each takes 1 unit time to paint 1 unit… Read More »

## Number of days after which tank will become empty

Given a tank with capacity C liters which is completely filled in starting. Everyday tank is filled with l liters of water and in the… Read More »

## Shuffle 2n integers in format {a1, b1, a2, b2, a3, b3, ……, an, bn} without using extra space

Given an array of 2n elements in the following format { a1, a2, a3, a4, ….., an, b1, b2, b3, b4, …., bn }. The… Read More »