Help needed for a data structure problem

Правка en1, от rofi93, 2017-01-02 08:55:20

Problem: You are given an array consisting of n elements and q queries in the form of [L,R]. You have to output the maximum occurrences of a number in the segment [L,R] for each query.

How to solve these kind of problems using Segment Tree ?? I can solve this using sqrt decomposition, but got stuck trying to solve using segment tree.

Теги segment tree, sqrt_decomposition, advanced data structure

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский rofi93 2017-01-02 08:55:20 378 Initial revision (published)