Binary Search Trees in STL??

cycleman77

Senior member
Jan 16, 2001
352
0
0
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
 

cycleman77

Senior member
Jan 16, 2001
352
0
0
Any one here use trees at all?
No one knows if there is anything in the Standard Template Library for Binary Search Trees?
 

zephyrprime

Diamond Member
Feb 18, 2001
7,512
2
81
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.