int binarySearch(vector<int>& a, int x) { int lo = 0, hi = a.size() - 1; while (lo <= hi) { int mid = lo + (hi - lo) / 2; // O(log n) ✓
DSA Bootcamps
Structured sessions on Data Structures and Algorithms, from arrays to graphs and dynamic programming.