SEARCHTREE

Classes:

Files:

The use of theese two template classes (balanced_search_tree, search_tree) is indexing. You can store there data named by ids (can not repeat). It looks like this:
(balanced_)search_tree< type_of_index, type_of_stored_data > name_of_variable Both, index and storad data, can be of any class type, int, bool... However, if you use pointers, they are't freed, it's your task.

The difference about them is just little. It is used exactly the same way, you may notice that balanced_search_tree inherits from search_tree, the only point is in internal data storing. That balanced balances the nodes there, and therefore is in most situationes faster than the unbalanced. The only time the it is better to use the unbalanced one is when you once put data in and one takes them out and that data don't come sorted. The balanced's time difficulty is n * log(n), the unbalanced can sometimes slow down to n * n.

Interface

Error handling

The error handlig is like in whole vorlib. See exception for details. Exception class is tree_e, codes are below: