STL Flashcards
1
Q
What does STL unique do?
A
Eliminates all except the first element from every consecutive group of equivalent elements from (first to last) and returns a past the end iterator for the new logical end of the range.
2
Q
What is STL unique complexity?
A
Complexity is std::distance(first, last) - 1, meaning N
3
Q
How does STL unique work?
A
Removing is done by shifting the elements in the range in such a way that elements to be erased are overwritten.