Offline Implementation

Segment Tree:

  1. Find min and max of the range | LightOJ: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/2e09ccd17e30054cbbe83029f097d822ef5e913e/LightOJ/Segment%20Tree/Ghajini.cpp
  2. Range Query in string | Each query ( substring ) Is Balanced Regular Expression or Not ? | Toph: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/Toph/Segment%20tree/wait.cpp
  3. Range query | maximum length of correct bracket subsequence | CodeForces: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/Codeforces/segment%20tree/C.%20Sereja%20and%20Brackets.cpp
  4. Range GCD , Minimum and it's occurance in the range | Codeforces: https://github.com/MehrajShakil/Data-structure/blob/master/Segment%20Tree/F.%20Ant%20colony.cpp
  5. Each query find max element less than or equal to x into give range | seg tree + merge sort | SPOJ: https://github.com/MehrajShakil/problem-solve-from-Morass-blog/blob/master/Segment%20Tree/ADATREE%20-%20Ada%20and%20Trees.cpp
  6. Range max | SPOJ: https://github.com/MehrajShakil/problem-solve-from-Morass-blog/blob/master/Segment%20Tree/THRBL%20-%20Catapult%20that%20ball.cpp

C++ STL: Policy base data structures:

  1. Number of elements greater than x or less than x | Short code | CodeForces : https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/Codeforces/E.%20Enemy%20is%20weak.cpp

Binary Indexed Tree:

  1. increasing subsuquence of a fixed lenght | unique elements | small length | CodeForces : https://github.com/MehrajShakil/problem-solve-from-Morass-blog/blob/master/BIT/C.%20Subsequences.cpp

Sparse Table:

  1. Range GCD || CodeForces: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/Regular%20contest%20solution%20from%2001-08-2021/CodeForces/Codeforces%20Round%20%23736%20(Div.%202)/D.%20Integers%20Have%20Friends.cpp
  2. Range GCD | all pair gcd summation | SPOJ: https://github.com/MehrajShakil/problem-solve-from-Morass-blog/blob/master/Segment%20Tree/ADAGF%20-%20Ada%20and%20Greenflies%20(%20sprase%20table%20solution%20).cpp
  3. Range max | with constant time query | SPOJ: https://github.com/MehrajShakil/problem-solve-from-Morass-blog/blob/master/Sparse%20Table/THRBL%20-%20Catapult%20that%20ball.cpp

DSU:

  1. DSU implementation || simple || CodeForces: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/Codeforces/DSU/D1.%20Mocha%20and%20Diana%20(Easy%20Version).cpp
  2. DSU implementation || simple || CSES: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/CSES/Graph%20Algorithms/Road%20Construction.cpp

MO's Algorithm:

  1. Range query || number of distinct elements into the range || Toph: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/Toph/MO's%20Algorithm/Crayons.cpp

Trie:

  1. Maximum xor sum of Subarray : https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/CSES/Additional%20Problems/Maximum%20Xor%20Subarray.cpp

Online Implementation

Binary Indexed Tree:

  1. Range sum | Point update | short code | LightOJ: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/LightOJ/Binary%20Indexed%20Tree/1112%20-%20Curious%20Robin%20Hood.cpp

Segment Tree:

  1. Range sum | Range update | LightOJ: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/LightOJ/Segment%20Tree/Horrible%20Queries.cpp
  2. Range queries | Bitwise 'or' and 'xor' operation | Point update | CodeForces: https://github.com/MehrajShakil/Data-structure/blob/master/Segment%20Tree/D.%20Xenia%20and%20Bit%20Operations.cpp
  3. Range queries | XOR | Range update | 2D | CodeForces: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/Codeforces/E.%20XOR%20on%20Segment.cpp
  4. Range Queries | second max element | Point Update | SPOJ: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/SPOJ/segment%20tree/KGSS%20-%20Maximum%20Sum.cpp
  5. Range Query in string | Each query ( substring ) Is Balanced Regular Expression or Not ? | Point update | SPOJ: https://github.com/MehrajShakil/Solving-problem-in-different-OJ/blob/master/SPOJ/segment%20tree/BRCKTS%20-%20Brackets.cpp
  6. Range GCD | point Update | CodeForces: https://github.com/MehrajShakil/problem-solve-from-Morass-blog/blob/master/Segment%20Tree/D.%20Bash%20and%20a%20Tough%20Math%20Puzzle.cpp
  7. Range query count number of primes | range update | SPOJ: https://github.com/MehrajShakil/problem-solve-from-Morass-blog/blob/master/Segment%20Tree/CNTPRIME%20-%20Counting%20Primes.cpp