# Tag Archives: Segment-Tree

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:   1â€¦ 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} Output: 6 Everyâ€¦ 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 Sâ€¦ 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)â€¦ 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.Examples:  â€¦ Read More
Given an array of size N, initially consists of zeroes only. The task is to apply the given operation q times and find the numberâ€¦ 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
Given an array arr[] of N integers and queries Q. Queries are of two types:  Update a given index ind by X. Find the gcdâ€¦ Read More