My guess is that trees were not included since they (as in balanced binary trees) are typically used to implement sets and maps, and these are already included.
Originally Posted by Bjarne Stroustrup (2000-10-14)
I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
Why there is no Tree data structure in STL?
Is it not needed so much? Or can it be done easily with other Data Structures?
STL provides containers, not data structures. The std::map container is, most likely, implemented as a binary tree. It must be so, in order to guarantee the time complexity specified by STL. But STL does not technically concern itself with such things -- it makes certain time guarantees and iterator guarantees, nothing else. A std::map guarantees that the time to access a member is O(log n) in the number of members and that iteration is roughly linear. In practice, this is achieved through a tree, but you can't make that assumption.