• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Binary Search Trees in STL??

cycleman77

Senior member
Is there anything in the STL for Binary Search Trees?
Our professor taught us what BSTs are and what we can us them for, but he didn't really tell us how to impliment them. Our text book doesn't help that much either.

Are there commands/functions already built into the STL for Binary Search Trees?
Is there a website or source I can go to for more information about implimentation?

Thanks
 
Any one here use trees at all?
No one knows if there is anything in the Standard Template Library for Binary Search Trees?
 
There is. The "set" & "multiset". The STL is intended to abstract data structures so you don't need to know exactly what kind of structure you're using. But in fact, it does a really poor job of abstracting them. How could they? How many algorithms are there that act like a set and meet its requirements? I've never heard of an STL implementation that doesn't use a kind of binary tree to implement the set.

The set is usually a red black tree because a simple binary search tree isn't so great in practice.
 
Back
Top