#ifndef _BINARY_SEARCH_TREE_H_
#define _BINARY_SEARCH_TREE_H_

#include <iostream.h>       
#include <string>
#include <fstream>

class BinaryNode
{
   public:

    int number;
    BinaryNode *left;
    BinaryNode *right;

  
    // constructor 
    BinaryNode(int NUMBER,  BinaryNode *LEFT, BinaryNode *RIGHT )
      				: number( NUMBER ), left( LEFT ), right( RIGHT ) { }


}; 



class BinarySearchTree
{
public:
    
    BinarySearchTree(  ); // constructor.
    ~BinarySearchTree( ); // destructor.
    int tsize;
    int getsize();
    void insert( BinaryNode& node ) ;   // insert the binary node in tree.
    void remove( int x );     // remove a binary node from the tree.
    const BinaryNode* find( int number ) const;  // seach a node by name and return that node's address.
    void print( ) const;        // print the complete list in the tree.
    void print( int ch );      // print those records that start with a specific charater.
    void height() ;             // determine the height of the tree.
    bool isEmpty();
    int height(BinaryNode *rootNode) ;  
    int sum();
    bool completeTree();
    BinaryNode* getroot();
    bool similarTree(BinarySearchTree *tree1, BinarySearchTree *tree2);
    
    
private:
  //  int tsize=0;
    BinaryNode* root;
    int getinfo(BinaryNode *, int);
    void insert( BinaryNode* & rnode , const BinaryNode& node );
    int sum(BinaryNode * rootNode);
    void printInorder( BinaryNode*  ) const;
    void printByFirstLetter( BinaryNode *temp ,int ch ) const;
    void remove(  BinaryNode* &node ,int x );    
    bool completeTree(BinaryNode * rootNode);
};
#endif


