Disjoint Set Union (DSU)


You can take the DSU structure used by me in the following link Problem Solution, also you can try to solve the problem and see how I simply called DSU dsu(n) of size n and to unite I used dsu.unite(a , b) , to find the parent use dsu.find(a) , to find the size of a component use dsu.siz(a).
Link for example code DSU


Segment Tree


There are two codes for segment tree one is written by tourist and other is standard code.
Link for the standard code Standard Segtree
Link for tourist segtree Segtree


Fenwick Tree


Link for the Code with example.


Sparse Table


Link for the Code with example.


Prime Finder


The code uses sieve of eratosthenes.
Link for the Code with example.


Lowest Common Ancestor


Link for the Code with example.


Dijkstra Shortest Path


Link for the Code with example.


Prims MST


Link for the Code with example.