Vector in C++ STL | Part 3/3 | push_back, pop_back, clear, size, resize, reverse | STL for Beginners

preview_player
Показать описание
5mins STL is a series that covers all important STL topics in a quick but concise manner
PPa Mentor Suraj Singh is also an expert at Codeforces and 5 star at Codechef

If you are preparing for coding interviews for top product-based companies then you should check out "Renaissance" our coding interview preparation platform where we teach our students how to master DSA, System design, low-level design, and how to become 100% coding interview ready!

Рекомендации по теме
Комментарии
Автор

Nice teaching technique in easy language with example, but in the last example
reverse(v.begin(), v.begin() + 2) will come if we want to reverse the first two element.
If we want to reverse the whole string then we are giving reverse(v.begin(), v.end()), in reverse syntax second element will be last element + 1. that why we are giving v.end() that represent imaginary 0 after last element.
similarly, if we want to reverse the first two element then second parameter will be v.begin()+2.

sagartalole
Автор

amazing method to explain keep it up 👍

SarveshKumar-blin