Templates
Binary SearchBinary search is the searching strategy that reduces the search space by half every iteration until you have found the target.Bit ManipulationBit Manipulation utilises different bitwise operations to manipulate bitsEuler PathEuler path templates for traversing every edge exactly once, including Hierholzer's algorithm.Fenwick TreeFenwick tree templates for efficient prefix sums, range queries, and point updates.Graph TheoryGraph theory templates for tree traversal, shortest paths, topological sorting, and related algorithms.Linked ListLinked list templates for common pointer techniques such as Floyd's fast and slow pointers.Manacher's AlgorithmA famous algorithm and the fastest known technique to find palindromic substrings of even or odd length.Ordered Set and GNU C++ PBDSa policy based data structure in g++ that keeps the unique elements in sorted orderPrefix SumPrefix and suffix sum templates for answering range sum queries efficiently.Segment TreeSegment tree templates for range queries and point updates on arrays.Sparse TableRange Queries finding min, max, gcd, lcm, and etc. The array cannot be changed between two queries.Two PointersTwo pointers templates for scanning arrays from both ends or maintaining paired indices.