## Segment Trees | (Product of given Range Modulo m)

Let us consider the following problem to understand Segment Trees. We have an array arr[0 . . . n-1]. We should be able to 1… Read More »

Let us consider the following problem to understand Segment Trees. We have an array arr[0 . . . n-1]. We should be able to 1… Read More »

Given an array A of N integers. There are three type of type of commands: 1 x : Right Circular Shift the array x times.… Read More »

We have briefly discussed sparse table in Range Minimum Query (Square Root Decomposition and Sparse Table) Sparse table concept is used for fast queries on… Read More »

Given an array A[] of size N. Solve Q queries. Find the product in range [L, R] under modulo P ( P is Prime). Examples:… Read More »

Given a range [L, R], we need to find the count of total numbers of prime numbers in the the range [L, R] where 0

Given an array A of size N, containing integers. We have to answer Q queries where each query is of the form: K L R… Read More »

This is Range query question in which we have been provided with and array of size N. Given are 3 types of queries and you… Read More »

Given an array of n integers. You are given q queries. Write a program to print floor value of mean in range l to r… Read More »

Given an array of size ‘n’ and a given set of commands of size ‘m’. Every command consist of four integers q, l, r, k.… Read More »

An array consisting of N integers is given. There are several Right Circular Rotations of range[L..R] that we perform. After performing these rotations, we need… Read More »

Given an array arr of integers of size n. We need to compute sum of elements from index i to index j. The queries consisting… Read More »

Given an array of size n and a give set of commands of size m. The commands are enumerated from 1 to m. These commands… Read More »

Consider a binary array consisting of N elements (initially all elements are 0). After that you are given M commands where each command is of… Read More »

Given an array containing n integers and a value d. m queries are given. Each query has two values start and end. For each query,… Read More »

Given an array of N positive integers. There are Q queries, each include a range [L, R]. For each query output the xor of greatest… Read More »