What is the STL?
The Standard Template Library is a collection of ready-to-use data structures and algorithms in C++. Mastering the STL is essential for competitive programming — it saves you from writing boilerplate code.Vector
A dynamic array that can grow and shrink.Iterating
Set
A collection of unique elements, automatically sorted. Operations are O(log n).Multiset
Likeset, but allows duplicates:
Map
A collection of key-value pairs, sorted by key. Operations are O(log n).Frequency counting with map
Stack
LIFO (Last In, First Out):Queue
FIFO (First In, First Out):Summary table
Practice
Sheet 5: STLs 1
Practice problems for this tutorial.