Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// O(n) complexity
std::advance(linkedList.begin(), n);
// O(1) complexity (taking advantage of random access iterator)
std::advance(vector.begin(), n);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment