-
randomly remove elements
It seems more difficult than i thought...
Ok,another question..Suppose that i have a set( vector) with n elements. How can i remove randomly let's say half of them??
All the remove algorithms of C++ satisfy a criterion. I don't need one. Just randomly remove some elements.
Thanx
-
a vector? Do a random_shuffle and then resize the vector to half its size.
-
Oh, and I think you double posted Joan :}
-
Yes, swgh..i didn't do it on purpose..
sorry
-
I meant it light-heartedly, no need to apoligise, it is a mistake we all make once, somtimes this board is rather slow at processing a message :)
-
Yes, exactly..i think that happend..
Anyway, have u looked at my previous thread??
Have u any idea?? anything would be helpful..if you don't understand sth from my description ask me.. :-)
-