Is there a way to make a data structure same as sets in c++ in python which is equally convenient and optimized? [duplicate]

  bisect, c++, python, set

I want to know if there is way to make a data structure same as std::sets in c++ in python which is equally convenient and optimized? That is all the operations such as inserting, erasing can be done in log(n) time while maintaining the list sorted. I know about bisect module but it does not provide any functions to remove or erase an element from list optimally. Also I am not sure about time complexity of erase function in sets.
Thank You

Source: Windows Questions C++

LEAVE A COMMENT