A powerful start to mastering C++ STL with foundational concepts, properties, and real code.


📚 Week 1: STL I – Introduction to Containers & Adapters

🧠 1. Introduction


📦 2. Sequential Containers

🔹 Array

int arr[3] = {1, 2, 3};
cout << arr[1]; // 2

🔹 Vector

Operation Time Complexity
Random Access O(1)
Insert Back O(1)
Insert Middle/Front O(n)
Erase Back O(1)
Erase Middle/Front O(n)
vector<int> v1;           // empty
vector<int> v2(5);        // [0,0,0,0,0]
vector<int> v3(5, 3);     // [3,3,3,3,3]