Determining if an unordered vector has all unique elements
Your first example should be O(N log N) as set takes log N time for each insertion. I don’t think a faster O is possible. The second example is obviously O(N^2). The coefficient and memory usage are low, so it might be faster (or even the fastest) in some cases. It depends what T is, … Read more