// Justin C. Miller
// University of Wisconsin Oshkosh
// Made for: http://www.geocities.com/neonprimetime.geo/index.html
// Date: 2001
// Borland Builder 4.0
//
// BST2.h Binary Search Tree
//
#ifndef BST_H
#define BST_H
#include
#include "BinaryTree2.h"
template
class BST : public BinaryTree
{
protected:
BNode * SubtreeMin ( BNode *) const ;
BNode * Search ( BNode * u, T & skey, bool & success) const ;
BNode * DeleteNode( T & skey, BNode * u, bool & success) ;
int Depth ( BNode * t , T & skey) const ;
public:
BST() : BinaryTree () {}
~BST() {}
BST(const T & elm) : BinaryTree (elm) {}
void Error(char * s) const
{
cerr<<"\nFatal Error in BST: " << s << endl ;
exit(1) ;
}
int Depth ( T & skey) const {return Depth(root, skey) ;}
T & Search ( T & skey, bool & success) const ;
bool Insert( T & item) ;
bool Delete( T & skey) ;
T & Minimum ( bool & success ) const ;
BST & operator=(const BST &) ;
friend ostream & operator<<(ostream & os, const BST & tree)
{return operator<<(os,BinaryTree)tree);}
bool IsEmpty() const {return root == 0;}
};
#endif
               (
geocities.com/neonprimetime.geo/cpp)                   (
geocities.com/neonprimetime.geo)