Horje
Array Range Queries

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 queries of a particular type mentioned in terms of an interval of the indices.

The specific query can be of type – maximum element in the given range, most frequent element in the given range or queries like these.

Types of Array Range Queries:

Array range queries can be classified based on the type of input provided and on the type of output:

1. Based on the type of input:

  • The value of interest is completely determined by the problem, in this case, the query consists of only a range of indices.
  • A single value of interest is provided in the query.
  • The query consists of a threshold where all the values above or below the threshold are of interest.
  • The query consists of an exact threshold value.

2. Based on the type of output:

  • Returns a single value matching the criteria.
  • Index of an element that matches the criteria provided in the query.
  • A list of all values that satisfy the given criteria.
  • Only a response like “yes” or “no” denoting if there is any result matching the criteria of the query.

Easy Problems on Array range Queries:

Medium Problems on Array range Queries:

Hard Problems on Array range Queries:

Quick Links :




Reffered: https://www.geeksforgeeks.org


Arrays

Related
Searching in Array Searching in Array
Subarray, Subsequence and Subsets in Python Subarray, Subsequence and Subsets in Python
Exponential value sort Exponential value sort
Minimize the shift required to make arr1[i] Minimize the shift required to make arr1[i]
How to Create Array of Arrays in C++ How to Create Array of Arrays in C++

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
16