How to efficiently remove an element from a vector ?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Uday DodiyaRank #239 · 10.3K reputationPosted Oct 1, 2022, 6:47 AM EDT
Hi Suri
Please Refer Following
https://iq.opengenus.org/ways-to-remove-elements-from-vector-cpp/
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Oct 1, 2022, 8:39 AM EDT
Depends on:
- whether you want to preserve the order or not
- whether you already have an iterator/index of an element, or need to search for it