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
GfG 160
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
DSA
Practice Problems
Python
C
C++
Java
Courses
Machine Learning
DevOps
Web Development
System Design
Aptitude
Projects
Sign In
▲
Similar Topics
DSA
22.3k+ articles
Arrays
6.4k+ articles
Competitive Programming
2.3k+ articles
Algorithms
1.9k+ articles
Sorting
1.7k+ articles
Tree
1.4k+ articles
subarray
640+ articles
number-digits
600+ articles
Advanced Data Structure
580+ articles
array-range-queries
360+ articles
MO's Algorithm
7 posts
Popular Articles
Recent Articles
Maximum occurring element in a subarray range (Mode queries)
Last Updated: 24 July 2023
Given an array arr[] of N integers, and an array Q[] of M pairs, where a pair represents a query of the form {L, R}, the task is to find the
...read more
Arrays
Algorithms
Advanced Data Structure
Competitive Programming
subarray
array-range-queries
cpp-map
frequency-counting
MO's Algorithm
DSA
Working and need of Mo's Algorithm
Last Updated: 02 November 2023
Mo's Algorithm is a generic algorithm. It can be used in many problems that require processing range queries in a static array, i.e., the ar
...read more
Articles
Algorithms
Analysis of Algorithms
array-range-queries
MO's Algorithm
DSA
Count of distinct colors in a subtree of a Colored Tree with given min frequency for Q queries
Last Updated: 17 March 2023
Given a N-ary tree with some colour associated with every node and Q queries. Each query contains two integers A and X. The task is to count
...read more
Arrays
Tree
Greedy
Sorting
Advanced Data Structure
Competitive Programming
DFS
sliding-window
Recursion
array-range-queries
two-pointer-algorithm
MO's Algorithm
DSA
Similar Topics
DSA
22.3k+ articles
Arrays
6.4k+ articles
Competitive Programming
2.3k+ articles
Algorithms
1.9k+ articles
Sorting
1.7k+ articles
Tree
1.4k+ articles
subarray
640+ articles
number-digits
600+ articles
Advanced Data Structure
580+ articles
array-range-queries
360+ articles
Queries for count of even digit sum elements in given range using MO's Algorithm
Last Updated: 01 November 2023
Given an array arr[] of N elements, the task is to answer Q queries each having two integers L and R. For each query, the task is to find th
...read more
Arrays
Algorithms
Competitive Programming
number-digits
array-range-queries
MO's Algorithm
DSA
Range Queries for count of Armstrong numbers in subarray using MO's algorithm
Last Updated: 25 April 2023
Given an array arr[] consisting of N elements and Q queries represented by L and R denoting a range, the task is to print the number of Arms
...read more
Arrays
Algorithms
Sorting
Competitive Programming
number-digits
array-range-queries
MO's Algorithm
DSA
Range Queries to count elements lying in a given Range : MO's Algorithm
Last Updated: 27 April 2023
Given an array arr[] of N elements and two integers A to B, the task is to answer Q queries each having two integers L and R. For each query
...read more
Arrays
Algorithms
Competitive Programming
array-range-queries
MO's Algorithm
DSA
Count of odd and even parity elements in subarray using MO's algorithm
Last Updated: 10 January 2024
Given an array arr consisting of N elements and Q queries represented by L and R denoting a range, the task is to print the count of odd and
...read more
Arrays
Algorithms
Competitive Programming
subarray
MO's Algorithm
DSA
1
1
1
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 !