|
|
|
|
|
by mehrdadn
1927 days ago
|
|
Ordering is not the only concern here. std::set actually provides a logarithmic worst-case guarantee, whereas std::unordered_set does not. This is a factor to consider depending on the application, regardless of whether ordering is necessary. Whichever one prefers in any case, though, is beside my point—I'm merely trying to use trees and hashtables to illustrate a far more general CS phenomenon that can occur in lots of data structures and languages. |
|
There may be a benchmark out there where std::set can beat std::unordered_set, but you'll be really hard pressed to find it