# Tag Archives: square-root-decomposition

## Square root of a number by Repeated Subtraction method

Given an integer N, the task is to find its perfect square root by repeated subtraction only.Examples:    Input: N = 25 Output: 5Input: N =… Read More »

## Find sum of product of every number and its frequency in given range

Given an array arr[] of integers and an array of queries, the task is to find the sum of product of every number and its… Read More »

## C program to find square root of a given number

Given a number N, the task is to write a C program to find the square root of the given number N. Examples:  Input: N… Read More »

## Queries for elements having values within the range A to B using MO’s Algorithm

Prerequisites: MO’s algorithm, SQRT Decomposition Given an array arr[] of N elements and two integers A to B, the task is to answer Q queries… Read More »

## Number of elements less than or equal to a number in a subarray : MO’s Algorithm

Given an array arr of size N and Q queries of the form L, R and X, the task is to print the number of… Read More »