On 02.07.2012 14:49, Sturla Molden wrote: > I think (in C++11) std::unordered_set and std::unordered_map should be > used instead. They are hash-based with O(1) lookup. > > std::set and std::map are binary search threes with average O(log n) > lookup and worst-case O(n**2). Sorry typo, that should be worst-case O(n). Sturla