Tutorials
Courses
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
32.7K+ articles
DSA
20.1K+ articles
Misc
7.8K+ articles
Mathematical
5.1K+ articles
Arrays
4.2K+ articles
Bit Magic
826+ articles
Bitwise-XOR
443+ articles
prefix-sum
348+ articles
Advanced Data Structure
311+ articles
Segment-Tree
156+ articles
array-range-queries
376+ posts
Recent Articles
Popular Articles
Find the final Array by updating given Ranges
Last Updated: 05 December 2022
Given an array arr[] consisting of N integers and an array Q[][3] consisting of M queries of the form [L, R, U], the task for each query is to xor every array element over...
read more
Technical Scripter
Technical Scripter 2022
DSA
Arrays
array-range-queries
prefix-sum
2D Range Minimum Query in O(1)
Last Updated: 28 April 2023
Given a matrix mat[][] of size N*M, the task is to find the minimum value in a submatrix of the array, defined by the top-left and bottom-right indices of the submatrix fo...
read more
Picked
Technical Scripter 2022
DSA
array-range-queries
Print the sum of array after doing k queries on the array
Last Updated: 10 February 2023
Given an array, arr[] of size n. Calculate the sum of arr[] by performing k queries on arr[], such that we have to add an element given in array y[], on the basis of the b...
read more
Technical Scripter 2022
DSA
array-range-queries
Minimum Possible Cost of Flight ticket required to reach the city D
Last Updated: 01 December 2023
Given two integers N, D and an array A[] of size N where A[i] represents the population of ith city. For any city i, there are two flights to city (i+1) and to city (i+3),...
read more
Geeks Premier League
DSA
Arrays
array-range-queries
Algorithms-Dynamic Programming
Find maximum difference between elements having a fixed index difference of K
Last Updated: 16 November 2023
Given an integer K and an unsorted array of integers arr[], find the maximum difference between elements in the array having a fixed index difference of K.Examples: Input:...
read more
Mathematical
DSA
Arrays
array-range-queries
Arrays
Find Next Optimal Range in Array
Last Updated: 06 December 2023
Given an array ranges[][] of size N x 2, where for every i, range[i][0] is the start and range[i][1] is the end of the range. For every range, find the index of the Next O...
read more
Geeks Premier League
DSA
Arrays
array-range-queries
Geeks Premier League 2023
Fastest Horse Query in a Race
Last Updated: 25 January 2024
Given ‘N’ horses running in ‘N’ different lanes numbered from 1 to ‘N’. You are given an array “FINISHTIME” containing ‘N’ integers where “FINISHTIME[i]” represents the ti...
read more
Picked
Geeks Premier League
DSA
Arrays
array-range-queries
Goldman Sachs
Huawei
QA - Placement Quizzes-Data Interpretation
Scala-Arrays
Volkswagen IT Services
Geeks Premier League 2023
Find Maximum Difference Between any Two Pairs By Following Operations Optimally
Last Updated: 31 December 2023
Given an array X[] of length N along with A and B. You can apply below type of operations:Operation 1: Choose two different indices, delete elements at both indices and in...
read more
DSA
array-range-queries
Algorithms-Greedy Algorithms
Greedy Algorithms
Java-Arrays
DSA-Blogs
Geeks Premier League 2023
Sum and Update Queries on 2D Matrix
Last Updated: 31 December 2023
Given a 2D matrix mat[][] of size NXN with all its elements initialized to 0, the task is to answer Q queries. Each query[i] can be one of the following types:Type 1 [1, x...
read more
DSA
array-range-queries
Binary Indexed Tree
Segment Trees for Competitive Programming
Last Updated: 20 December 2023
Segment Tree is one of the most important data structures used for solving problems based on range queries and updates. Problems based on Segment Trees are very common in ...
read more
Competitive Programming
array-range-queries
Segment-Tree
Segment Tree for Range Multiplication and Sum Queries
Last Updated: 18 March 2024
Given an array of size N filled with all 1s, the task is to answer Q queries, where the queries can be one of the two types: Type 1 (1, L, R, X): Multiply all elements on ...
read more
Picked
DSA
array-range-queries
Segment-Tree
Geeks Premier League 2023
Segment Tree for Range Assignment and Range Sum Queries
Last Updated: 20 February 2024
Given an array of sizeNfilled with all 0s, the task is to answerQqueries, where the queries can be one of the two types:Type 1 (1, L, R, X):Assign value X to all elements ...
read more
Picked
DSA
array-range-queries
Segment-Tree
Geeks Premier League 2023
CSES Solutions - Nested Ranges Check
Last Updated: 10 July 2024
Given N ranges, the task is to determine for each range if it contains some other range and if some other range contains it. Range [a,b] contains range [c,d] if a ≤ c and ...
read more
Competitive Programming
Picked
array-range-queries
CSES Problems
CSES Solutions – Static Range Sum Queries
Last Updated: 10 April 2024
Given an array arr[] of N integers, your task is to process Q queries of the form: what is the sum of values in range [a,b]?ExamplesInput: arr[] = {1, 3, 4, 8, 6, 1, 4, 2}...
read more
Competitive Programming
array-range-queries
prefix-sum
CSES Problems
Array Range Queries
Last Updated: 23 August 2024
The array range query problem can be defined as follows:Given an array of numbers, the array range query problem is to build a data structure that can efficiently answer q...
read more
DSA
Arrays
array-range-queries
1
2
3
4
...
26
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !