Random commentary about Machine Learning, BigData, Spark, Deep Learning, C++, STL, Boost, Perl, Python, Algorithms, Problem Solving and Web Search
lets say the current size of vector is n+1thenreverse (0,n)reverse (0,n-k)reverse (n-k+1,n)
lets say the current size of vector is n+1
ReplyDeletethen
reverse (0,n)
reverse (0,n-k)
reverse (n-k+1,n)