I have to implement method for removing specified element in vector. Does anybody knows algoritm for this method?
I need it because of brew platform doesn’t support STL.
Thanks in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The algorithm is fairly simple:
And then, it use the deletion by index. Your array is decomposed as:
You have to shift every elements from
[i+1]to[n]toward the beginning of the array (= shiftingpart 2towards the beginning of the array) in order to make the array still contiguous.