Can anyone tell me how to implement Binary tree using C++ STL set.
I have implemented binary t开发者_如何学Pythonree using structures in C and class in C++
struct binary {
int node;
struct binary *left;
struct binary *right;
};
I am not sure about how to implement it using STL set. Actually I don't know how to to represent left and right in set.
By the way, its not homework.
std::set
uses a binary (usually red-black) tree in its own implementation. You wouldn't want use it to implement a binary tree.
精彩评论