We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
If you want O(N) use std::unordered_set, std::set is based on balanced search tree with a O(log(N)) complexity for search and insert, while unordered_set uses hash table with an expected constant time lookup.
Pairs
You are viewing a single comment's thread. Return to all comments →
If you want O(N) use std::unordered_set, std::set is based on balanced search tree with a O(log(N)) complexity for search and insert, while unordered_set uses hash table with an expected constant time lookup.