Range Minimum Query (Square Root Decomposition and Sparse Table)

In the range minimum query problem we have given a query and an integer array. Each query contains the range as left and right indexes for each range. The given task is to determine the minimum of all number that lies within the range. Example Input: arr[] = {2, 5, …

Read moreRange Minimum Query (Square Root Decomposition and Sparse Table)

GCDs of given index ranges in an array

Problem Statement The problem ‘GCDs of given index ranges in an array” states that you are given an integer array and some range queries. The problem statement asks to find out the Greatest Common Divisor of the sub-array so formed within the range. Example arr[] = {10, 5, 18, 9, …

Read moreGCDs of given index ranges in an array