algorithm - C++ STL set implementation -


why c++ set implemented binary tree instead of hashset, can provide average case complexity of o(1) compared o(log n) provided binary tree?

because c++ sets ordered t's comparison operator, makes possible iterate on members in predictable way. if know set insert, test membership, and/or remove elements, std::unordered_set, implements hashset, exists since c++11.


Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -