Skip to content
Courses
DSA to Development
Get IBM Certification
Newly Launched!
Master Django Framework
Become AWS Certified
For Working Professionals
Interview 101: DSA & System Design
Data Science Training Program
JAVA Backend Development (Live)
DevOps Engineering (LIVE)
Data Structures & Algorithms in Python
For Students
Placement Preparation Course
Data Science (Live)
Data Structure & Algorithm-Self Paced (C++/JAVA)
Master Competitive Programming (Live)
Full Stack Development with React & Node JS (Live)
Full Stack Development
Data Science Program
All Courses
Tutorials
Data Structures & Algorithms
ML & Data Science
Interview Corner
Programming Languages
Web Development
CS Subjects
DevOps And Linux
School Learning
Practice
Build your AI Agent
160 Days of DSA (Win T-Shirt!)
Problem of the Day
Practice Coding Problems
GfG SDE Sheet
Contests
Accenture Hackathon (Ending Soon!)
GfG Weekly [Rated Contest]
Job-A-Thon Hiring Challenge
All Contests and Events
Trending Now
DSA
Web Tech
Foundational Courses
Data Science
Practice Problem
Python
Machine Learning
JavaScript
System Design
Django
DevOps Tutorial
Java
C
C++
ReactJS
NodeJS
CP Live
Aptitude
Puzzles
Projects
Sign In
▲
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Competitive Programming
2.3k+ articles
Algorithms
1.9k+ articles
Tree
1.4k+ articles
Bit Magic
1.2k+ articles
Advanced Data Structure
580+ articles
prefix-sum
330+ articles
Segment-Tree
140+ articles
array-range-queries
360+ posts
Popular Articles
Recent Articles
Find the Array element after Q queries based on the given conditions
Last Updated: 23 February 2023
Given an array arr[] of length N and Q queries of 3 types (1, 2, 3) whose operations are as follows:Type 1: query has input as 1 and the tas
...read more
Arrays
Mathematical
Hash
HashTable
array-range-queries
DSA
C Program To Find Prime Numbers Between Given Range
Last Updated: 11 September 2024
A prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. For example, 2, 3, 5, 7, and 11 are
...read more
Mathematical
Prime Number
C Language
array-range-queries
C Programs
C++ Programs
C Basic Programs
DSA
Total numbers with no repeated digits in a range
Last Updated: 08 May 2023
Given a range[Tex]L, R[/Tex]find total such numbers in the given range such that they have no repeated digits. For example: 12 has no repeat
...read more
Mathematical
number-digits
prefix-sum
array-range-queries
DSA
Similar Topics
DSA
22.3k+ articles
Mathematical
7.7k+ articles
Arrays
6.4k+ articles
Competitive Programming
2.3k+ articles
Algorithms
1.9k+ articles
Tree
1.4k+ articles
Bit Magic
1.2k+ articles
Advanced Data Structure
580+ articles
prefix-sum
330+ articles
Segment-Tree
140+ articles
Difference Array | Range update query in O(1)
Last Updated: 29 March 2024
Consider an array A[] of integers and following two types of queries.update(l, r, x) : Adds x to all values from A[l] to A[r] (both inclusiv
...read more
Arrays
Advanced Data Structure
array-range-queries
DSA
Sparse Table
Last Updated: 29 March 2024
We have briefly discussed sparse table in Range Minimum Query (Square Root Decomposition and Sparse Table)Sparse table concept is used for f
...read more
Arrays
Advanced Data Structure
Technical Scripter
array-range-queries
DSA
Count Primes in Ranges
Last Updated: 13 December 2024
Given a range [L, R], we need to find the count of total numbers of prime numbers in the range [L, R] where 0 = L = R 10000. Consider that
...read more
Mathematical
sieve
Prime Number
prefix-sum
array-range-queries
DSA
Find element at given index after a number of rotations
Last Updated: 19 September 2023
Given an array of N integers, M ranges of indices as queries, and a specific index K, the task is to right rotate the array circularly betwe
...read more
Arrays
rotation
array-range-queries
DSA
Queries for counts of array values in a given range
Last Updated: 20 March 2025
Given an unsorted array of integers and a set ofmqueries, where each query consists of two integersxandy, the task is to determine the numbe
...read more
Arrays
Amazon
Binary Search
Competitive Programming
Segment-Tree
array-range-queries
DSA
Square Root (Sqrt) Decomposition Algorithm
Last Updated: 16 August 2023
Square Root Decomposition Technique is one of the most common query optimization techniques used by competitive programmers. This technique
...read more
Competitive Programming
array-range-queries
DSA
Range Minimum Query (Square Root Decomposition and Sparse Table)
Last Updated: 25 August 2023
We have an array arr[0 . . . n-1]. We should be able to efficiently find the minimum value from index L (query start) to R (query end) where
...read more
Advanced Data Structure
Competitive Programming
Segment-Tree
array-range-queries
DSA
MO's Algorithm (Query Square Root Decomposition) | Set 1 (Introduction)
Last Updated: 27 February 2025
Let us consider the following problem to understand MO's Algorithm. We are given an array and a set of query ranges, we are required to find
...read more
Algorithms
array-range-queries
DSA
Lazy Propagation in Segment Tree
Last Updated: 25 April 2023
Segment tree is introduced in previous post with an example of range sum problem. We have used the same "Sum of given Range" problem to expl
...read more
Advanced Data Structure
Segment-Tree
array-range-queries
DSA
Binary Indexed Tree or Fenwick Tree
Last Updated: 19 December 2024
Binary Indexed Trees are used for problems where we have following types of multiple operations on a fixed sized.Prefix Operation (Sum, Prod
...read more
Tree
Advanced Data Structure
Binary Indexed Tree
array-range-queries
DSA
Tutorials
Segment Tree | Range Minimum Query
Last Updated: 11 February 2025
We have introduced a segment tree with a simple example in the previous post. In this post, the Range Minimum Query problem is discussed as
...read more
Tree
Advanced Data Structure
Segment-Tree
array-range-queries
DSA
Segment Tree | Sum of given range
Last Updated: 09 March 2023
Let us consider the following problem to understand Segment Trees.We have an array arr[0 . . . n-1]. We should be able toFind the sum of ele
...read more
Arrays
Tree
Amazon
Mathematical
Advanced Data Structure
Segment-Tree
array-range-queries
DSA
1
2
3
4
5
6
7
8
>>
Last
1
2
3
4
5
6
>>
Last
1
2
3
4
>>
Last
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 !