I started coding recently and almost always on each contest either being codechef, codeforces, or any other platform they mostly have question in which we have to answer the query, and these type of question sometimes we need to pre-process, or use some other’s means to optimize it.
For eg, in MARCH20 long challenge WINWAYS2 Mo’s algorithm was introduced.
So i want to know what are other standard algorithms and data structures to deal with these type question.
1 Like
This site might help you i had the same question
Check out segment trees and fenwick trees! Both are very popular data structures used for range queries.
1 Like
wavelet tree may also help
Segment tree,fenwick tree,sqrt decomposition.