>RunTimeFix
BookStudyPracticeInterviewsYouTubeCoursesAbout
Log inGet Started
Free · 30 Chapters · 272 Pages

Study Library

Read the full content of Master Competitive Programming with C++ — free, in your browser, chapter by chapter.

From Master Competitive Programming with C++ by RunTimeFix

Browse All Chapters

All Chapters

Read front to back — each chapter builds on the last. Click any chapter to start reading.

01

C++ Foundations & Input/Output

Program Structure & Compilation · Variables & Data Types · Arithmetic Operations & Modulo · Integer Overflow & The 1LL Trick · Input/Output Streams & Fast I/O · Conditionals & Logical Operators

02

Loops & Direct Simulations

The Three Loop Structures · Loop Controls: break & continue · Nested Loops · Core Loop Patterns

03

Arrays, Strings & Character Operations

1D Arrays (C-Style) · 2D Arrays & Row-Major Layout · std::string & Character Operations

04

Functions & Recursion

Function Mechanics & Variable Scope · Parameter Passing: Value vs. Reference · Recursion & the Call Stack

05

Strings & Character Operations

std::string in C++ · Character Operations & ASCII Mathematics

06

Structs, Lambdas & Structured Bindings

Structures (Structs) in C++ · Lambdas & Inline Comparators · auto & Structured Bindings (C++17)

07

Preprocessor, Debug Macros & Compilation

The C++ Preprocessor & Macros · Compilation Pipeline & G++ Compiler Flags

08

Vectors, Pairs & Utility Algorithms

std::vector — The Dynamic Array · std::pair — Grouping Two Values · std::tuple — Grouping Three or More Values (D1) · String STL Methods (Advanced) · Iterators — The Bridge Between Containers and Algorithms · Utility Algorithms

09

Sets, Maps & Multi-Containers

std::set — Ordered Unique Elements · std::multiset — Ordered Elements with Duplicates · std::map — Key-Value Associations · std::unordered_map & std::unordered_set — Hash-Based Containers · std::stack — LIFO Container Adapter · std::queue — FIFO Container Adapter · std::deque — Double-Ended Queue · std::priority_queue — Heap-Based Container

10

Sorting & Frequency Arrays

std::sort — The Workhorse · lower_bound & upper_bound — Binary Search in STL · binary_search — Boolean Existence Check · unique — Removing Consecutive Duplicates · next_permutation — Generating Permutations · Sorting Applications · Frequency Counting

11

Complexity & Problem Solving

Reading Problem Statements · Complexity Analysis · Brute Force · Observation Finding · Edge-Case Handling · Debugging Techniques · Stress Testing

12

Basic Number Theory & Modular Arithmetic

Divisibility · GCD & LCM · Primes & Primality Testing · Sieve of Eratosthenes · Prime Factorization · Divisor Enumeration · Modular Arithmetic · Binary Exponentiation · Parity Arguments · Sum Formulas

13

Prefix Sums & Difference Arrays

1D Prefix Sums · 2D Prefix Sums · Suffix Sums & Suffix Aggregates · Difference Arrays

14

Two Pointers & Sliding Window

Two Pointers (Opposite Direction) · Two Pointers (Same Direction) · Sliding Window (Fixed Size) · Sliding Window (Variable Size)

15

Binary Search (Array & Answer Space)

Binary Search on a Sorted Array · STL Binary Search Functions · Binary Search on the Answer · Boundary Handling

16

Greedy Algorithms & Constructive Problems

The Greedy Paradigm · Sorting-Based Greedy · Interval Scheduling (Activity Selection) · The Exchange Argument · Constructive Algorithms

17

Bit Manipulation & Masking

Bitwise Operators · Bit Tricks · XOR Properties · Bitmask Enumeration · __builtin Functions

18

Stacks, Queues & Monotonicity

Stack Applications · Queue Applications · Monotonic Stack · Monotonic Deque (Sliding Window Min/Max)

19

Disjoint Set Union (DSU)

The Problem DSU Solves · Naive Implementation · Optimization 1: Path Compression · Optimization 2: Union by Rank/Size · Component Queries

20

Coordinate Compression, Fenwick Tree & Segment Tree

Coordinate Compression · Fenwick Tree (Binary Indexed Tree) · Segment Tree · Sparse Table (D1 — Recognition)

21

Graph Representation, DFS & BFS

Graph Terminology · Graph Representation · DFS on Graphs · BFS on Graphs · Connected Components · Grid Traversal

22

Cycle Detection, Bipartite Checking & Topological Sort

Cycle Detection in Undirected Graphs · Cycle Detection in Directed Graphs · Bipartite Checking · Topological Sort · DAG Reasoning · Functional Graphs

23

Dijkstra, 0-1 BFS & Kruskal's MST

Dijkstra's Algorithm · 0-1 BFS · Minimum Spanning Tree — Kruskal's Algorithm

24

Rooted Trees — DFS, Subtree Size & Diameter

Tree Terminology · Rooting a Tree · Tree Diameter · Distance Between Two Vertices · Tree Algorithms: Summary of Techniques

25

Binary Lifting, LCA & Euler Tour

Binary Lifting · Lowest Common Ancestor (LCA) · Euler Tour

26

Dynamic Programming — Foundations

The DP Paradigm · The DP Recipe · Classic DP Problems · Longest Increasing Subsequence (LIS) · Maximum Subarray Sum (Kadane's Algorithm)

27

Dynamic Programming — Knapsack & Subsets

The 0-1 Knapsack Problem · Unbounded Knapsack · Subset Sum & Knapsack Variants · Bitmask DP

28

Backtracking & Meet-in-the-Middle

The Backtracking Template · Generating Combinatorial Objects · Pruning · Meet-in-the-Middle

29

Modular Inverse, Combinatorics & Fast Math

Modular Multiplicative Inverse · Combinatorics: C(N, K) mod M · Common Combinatorial Problems · Matrix Exponentiation (Fast Math)

30

Hashing, String Algorithms & Geometry Basics

Polynomial Rolling Hashing · The Trie (Prefix Tree) · Geometry: The Cross Product · Book 1 Conclusion

>RunTimeFix

Practical programming education. Books, videos, courses, and hands-on learning for competitive programming, DSA, and software engineering.

RunTimeFix

  • About
  • YouTube
  • Book
  • Study Library
  • Courses

Learn

  • Competitive Programming
  • DSA
  • Development
  • Databases

Legal

  • Privacy
  • Terms
  • Refund Policy

RunTimeFix — debug → solve → run

© 2026 RunTimeFix. All rights reserved.