Let me put up my requirement straight away
*I want The vector to be updated rather than creating a new vector
*Will the complexity (running time) be better?
say for eg:
now all i wanted to do is to update the vector after a few steps...Code:#include<iostream> #include<vector> using namespace std; int main() { int i,j=0; vector < vector<long long int> > g(100); g[1].push_back(2); g[2].push_back(3); return(0); }
i want it to look like a new emplty vector with
ofcourse i can do it by creating a new vector with the second associations alone....Code:2 associated with 1 3 associated with 2...ie just the reverse of the previous one...i want the previous associations to be removed
but i dont need that...I want the original vector to be updated with minimal complexity