## Perform append, update, delete and range sum queries on the given array

Given an array arr[] of size N and the task is to answer Q queries of the following types: 1 X 0: Append X at… Read More »

- Queries for elements having values within the range A to B in the given index range using Segment Tree
- Dynamic Segment Trees : Online Queries for Range Sum with Point Updates
- Build a segment tree for N-ary rooted tree
- Sum and Maximum of elements in array from [L, R] before and after updates
- Range Sum and Update in Array : Segment Tree using Stack
- Queries to check if any non-repeating element exists within range [L, R] of an Array
- Lexicographical smallest number after at most K consecutive swaps
- Maximum pair sum in the given index ranges of an Array
- Range Queries for number of Armstrong numbers in an array with updates
- Array range queries to count the number of Fibonacci numbers with updates
- Sum of prime numbers in range [L, R] from given Array for Q queries
- Maximum of all subarrays of size K using Segment Tree
- Binary Array Range Queries to find the minimum distance between two Zeros
- Array Range Queries to find the Maximum Armstrong number with updates
- Count of divisors of product of an Array in range L to R for Q queries
- Queries for the count of even digit sum elements in the given range using Segment Tree.
- Queries for greatest pair sum in the given index range using Segment Tree
- Find the element having maximum set bits in the given range for Q queries
- Find array sum using Bitwise OR after splitting given array in two halves after K circular shifts
- Array range queries to find the number of perfect square elements with updates
- Maximum distance between two 1s in a Binary Array in a given range
- Array Range Queries to count Powerful numbers with updates
- Count of distinct numbers in an Array in a range for Online Queries using Merge Sort Tree
- Range Queries to find the Element having Maximum Digit Sum
- Range Queries to count the number of even parity values with updates
- Array range queries to find the maximum Fibonacci number with updates
- Range Update Queries to XOR with 1 in a Binary Array.

Given an array arr[] of size N and the task is to answer Q queries of the following types: 1 X 0: Append X at… Read More »

Given an array arr[] of N elements and a number of queries where each query will contain three integers L, R and K. For each… Read More »

Given an array of size N containing numbers only from 0 to 63, and you are asked Q queries regarding it. Queries are as follows:… Read More »

Given an array of integers, the task is to calculate the sum of GCD of all the subarrays of an array. GCD of an array… Read More »

Given an array arr[], the task is to find the count of sub-arrays with GCD equal to 1. Examples: Input: arr[] = {1, 1, 1}… Read More »

Given an array arr[], the task is to find the smallest sub-arrays with GCD equal to 1. If there is no such sub-array then print… Read More »

Given an array arr[] of N integers and Q queries where each query consists of an index range [L, R]. For each query, the task… Read More »

Given a string S of length N, and M queries of the following type: Type 1: 1 L x, Indicates update Lth index of string… Read More »

Given an array arr[] of N integers and Q queries. Each query can be represented by two integers L and R. The task is to… Read More »

Given an array arr of size N. The task is to find the kth smallest element in the subarray(l to r, both inclusive). Note :… Read More »

Given an array of size N.There can be multiple queries of the following types. update(l, r) : On update, flip( multiply a[i] by -1) the… Read More »

Given an in-order traversal of a cartesian tree, the task is to build the entire tree from it. Examples: Input: arr[] = {1, 5, 3}… Read More »

Given an array arr[] of length N, the task is to find the sum of the maximum elements of every possible sub-array of the array.… Read More »

Given an array of size N, initially consists of zeroes only. The task is to apply given operation q times and find the number of… Read More »

Given a binary array arr[] and q queries of following types: k: find the index of the kth set bit i.e. kth 1 in the… Read More »