Data Structure c++ - hashing (Binary Search Tree)

profilef.a.qx8t
assignment_7.zip

Client_Address_data.txt

Ramos Rafael 220 SW 3rd Street 447-4533 Enirata Jorge 6200 Miami Avenue 446-6666 Sexy Lady 400 Street East 555-1212 Smith John 444 SW 2nd Ave 420-6868 Winner Mary 3669 W Citrus Trace Drive 434-1717 Valdez Jorge 11885 SW 13th Court 476-8899 Valdes Abel 3353 Davie Blvd 587-1043 Smith Mary 444 SW 2nd Ave 420-6808 Edn Susan 8881 SW 49th Street 746-6998 Harper Fred 6815 NW 12th Street 572-3326 Tempero Douglas 436 NW 81st Street 462-1478 Utnik Richard 182 SW 51st Street 797-9905 Utich Michael 412 6th Street 556-8200 Lehrer Paul 9660 Sunrise Drive 485-6000 Leger George 811 SW 31st Street 390-7915 Harper Mary 6815 NW 12th Street 572-3326 Quass Claude North Ocean Drive 564-0674 Quinn Medicinewoman 4729 SW 42 Street 316-4455 Harper Jean 6815 NW 12th Street 572-3326 Harper James 6815 NW 12th Street 572-3326 Harper Babara 6815 NW 12th Street 572-3326 Edmundson Donald 321 Sunset Drive 745-6666 Ramos Miryam Post Gardens Way 393-6627 Cleary Kay 6250 SW 6th St 584-1023 Cleary Adele 3548 Envioronment Blvd 677-1056 MacDonald John 5601 Dixie Hwy 772-6712 Ilter Mehmet 2173 Bay Court 349-3128 Ilter Kermit 2163 Bay Court 349-3228 Ilter Maha 2163 Bay Court 349-3328 Macci Vicky 3535 Oceana Drive 446-8663 Tann Kyle 3027 N. Oakland Forest Drive 583-3362 Fox Smart 5600 Brian Street East 731-8685 Tanguay Albert 4806 NW 36st Street 731-7686 Tanguay Andre 555 University Drive 741-9728 Bullard Mark 770 SE 2nd Ave 393-7029 Bulldog Fred 555 W. Ocean Drive 737-0824 Bundle Joy 8352 Trent Ct 479-0349 Wickes Helen 1831 NE 38th Street 561-1228 Open Wide 5676 Street Avenue 543-0009 Wickham Fred 353 SW 18th Avenue 763-5252 Dunn Carrey 554 St. James Street 663-8900 Dandy Bread 1500 Publix Drive 555-1212 Nay John Eastlake Way 385-9286 Niwn Ni 6626 20th Street 888-0010 Young David 2121 NE 11th Ave 333-8483 Able Scott 9 NE 5th Court 456-0009 Abby Mary 3562 8th Street 492-4545 Young Andy 111 Cow Pen Road 448-8586 Young Celcil 6324 NW 29th Avenue 792-6327 Yau Kouassi 7801 NW 44th Ct 473-5456 Zangwill Andy 5990 Sunrise Lakes Blvd 746-9427 Jackson Jessie 2620 NW 21st Street 760-7511 Jackson Joanna 220 SW 20st Street 761-7211 Jackson Missy 20000 NW 21st Street 760-7111 Zangrille Juilus 2261 NE 67th Street 938-8919 Xyplex Networks 555 Seabreeze Blvd 713-8156 Xu Xinyun 4195 SW 67th Avenue 467-6556 Good Boy 1000 Heaven Street 111-1111 Kaiser Moe 1905 NW 46st Street 862-1156 Pretty Girl 19 Stay Home Avenue 234-5409 Tom Cat 111 Fish Avenue 333-3333 Kaiser Ronald 1905 NW 46st Street 422-5151 Kaiser Richard 1905 NW 46st Street 434-1106

hashing_BST.cpp

hashing_BST.cpp

//*****************************************************************************************************
// P R O G R A M  H E A D E R
//
//  Name: 
//  ID: 
//  Instructor: Dr. Bullard
//  Class: Data Structures
//  Term: Summer 2014
//  Assignment #7 Hashing
//  Due Date: August 1, 2014
//  Due Time: 10:00 PM
//  Points: 100
//  
//  Description: 
//  (1) Handling collision, (2) using hashing with linear functions, (3) implement a default constructor, 
//   destructor, (4) Hashing is enables access to table objects. Program will maintain the names (first and last names)
//   addresses and phone numbers in an address book by using a hash table.
//  
//  
//  
//
//
//****************************************************************************************************************

#include   < iostream >
#include   < string >
#include   < fstream >

using   namespace  std ;

class   BST_Node    //node in a BST
{
public :
    string firstname , lastname ,  address ,  phone_number ,   NewLastName ,   NewFirstName ,   value ;
     BST_Node    * lchild ,   * rchild ;     //left and right children pointers
};
class   Clients_Info_BST   //Binary Search Tree
{
public :

     Clients_Info_BST ();
     ~ Clients_Info_BST ();
     void   Insert ( const  string  & );
     void   Insert_Aux ( BST_Node   *   &  loc_ptr ,   const  string );
     void   Remove ( const  string  & );   
     void   Remove_Aux ( BST_Node   *  loc_ptr ,   const  string  & );  
     void   Update ( const  string  &  s );  
     void   Update_Aux ( BST_Node   *   &  loc_ptr ,  string s );  
     void   Print_Tree_Aux ( BST_Node   * );     
     void   Print ();  
     BST_Node   *   Search_Aux ( BST_Node   *  loc_ptr ,  string object );
     BST_Node   *   Search ( const  string  &  s );
     BST_Node   *  inorder_succ ( BST_Node   * );

     //other member functions you may need.


private :

     BST_Node   * root ;   //---state information

};
/*
*Function Name: Clients_Info_BST
Precondition: state of class has not be initialized
Postcondition: state has been initialized
Description: default constructor sets root to 0.*/
Clients_Info_BST :: Clients_Info_BST () //store the data in the hash table
{
    root  =   0 ;
};

/*Function Name:~~Clients_Info_BST
Precondition: checks to see if root is not equal to 0.
Postcondition: left child and right child are going to get destroyed
Description: Destructor destroys left child first then right child then it
deletes root*/
Clients_Info_BST ::~ Clients_Info_BST ()   //destructor
{
     if   ( root  !=   0 )
     {
     delete  root -> lchild ;
     delete  root -> rchild ;
     }
     delete  root ;
    
}
/*Function Name:Remove
Precondition: function gets called with a string
Postcondition: function calls Remove_Aux
Description: string gets removed*/
void   Clients_Info_BST :: Remove ( const  string  &  s )
{
     Remove_Aux ( root ,  s );
};
/*Function Name:Remove_Aux
Precondition: function gets called with a BST_Node * ptr and a string
Postcondition: function checks to see if loc_ptr is 0 and if the last name is 
greater than or less than
Description: string gets removed with direct recursion*/
void   Clients_Info_BST :: Remove_Aux ( BST_Node   *  loc_ptr ,   const  string  &  s )
{
     if   ( loc_ptr  ==   0 )
        cout  <<   "object not in tree\n" ;

     else   if   ( loc_ptr -> lastname  >  s )
         Remove_Aux ( loc_ptr -> lchild ,  s );

     else   if   ( loc_ptr -> lastname  <  s )
         Remove_Aux ( loc_ptr -> rchild ,  s );

     else
     {
         BST_Node   *  ptr ;

         if   ( loc_ptr -> lchild  ==   0 )
         {
            ptr  =  loc_ptr -> rchild ;
             delete  loc_ptr ;
            loc_ptr  =  ptr ;
         }
         else   if   ( loc_ptr -> rchild  ==   0 )
         {
            ptr  =  loc_ptr -> lchild ;
             delete  loc_ptr ;
            loc_ptr  =  ptr ;
         }
         else
         {
            ptr  =  inorder_succ ( loc_ptr );
            loc_ptr -> lastname  =  ptr -> lastname ;
             Remove_Aux ( loc_ptr -> rchild ,  ptr -> lastname );
         }
     }
}
/*Function Name:inorder_sucessor
Precondition: function gets called with BST *loc_ptr
Postcondition: ptr is set to the right child
Description: loop keeps going left until it reaches the last child*/
  BST_Node   *   Clients_Info_BST :: inorder_succ ( BST_Node   *  loc_ptr )
{

     BST_Node   * ptr  =  loc_ptr -> rchild ;

     while   ( ptr -> lchild  !=   0 )
     {
        ptr  =  ptr -> lchild ;
     }
     return  ptr ;
}
  /*Function Name: Print
 Precondition: Print gets called
 Postcondition: print calls print_tree_aux on the root of the tree
 Description: Data gets printed to screen*/
void   Clients_Info_BST :: Print ()
{
     Print_Tree_Aux ( root );

};
/*Function Name: Print
Precondition: Print gets called
Postcondition: print calls Print_Tree_Aux on the root of the tree
Description: Data gets printed to screen using direct recursion*/
void   Clients_Info_BST :: Print_Tree_Aux ( BST_Node   *  loc_ptr )
{
     if   ( loc_ptr  !=   0 )
     {
         Print_Tree_Aux ( loc_ptr -> lchild );
        cout  <<  loc_ptr -> lastname  <<   " " <<  loc_ptr -> firstname  <<   " " <<  loc_ptr -> address  <<   " "   <<  loc_ptr -> phone_number  <<  endl ;
         Print_Tree_Aux ( loc_ptr -> rchild );
     }
}
/*Function Name:Insert(const string & s)
Precondition: A string gets passed in and a new node is created
Postcondition: Inserted into correct location
Description: string gets chopped into pieces by last name, first name and phone number*/
void   Clients_Info_BST :: Insert ( const  string  &  s )
{
     BST_Node   * =   new   BST_Node ;

     int  last  =  s . find ( " " ,   0 );

    p -> lastname  =  s . substr ( 0 ,  last );

     if   ( p -> lastname  ==   "1"   ||  p -> lastname  ==   "2"   ||  p -> lastname  ==   "3"   ||  p -> lastname  ==   "4"   ||  p -> lastname  ==   "5"   ||  p -> lastname  ==   "6"   ||  p -> lastname  ==   "7" )
     {
         Update_Aux ( root ,  s );
     }
    
     else
     {
         Insert_Aux ( root ,  s );
     }
}
/*Function Name:Insert_Aux(BST_Node * & loc_ptr, string object)
Precondition: A string gets passed in and a new node is created
Postcondition: Inserted into correct location
Description: string gets chopped into pieces by last name, first name and phone number. function uses 
direct recursion*/
void   Clients_Info_BST :: Insert_Aux ( BST_Node   *   &  loc_ptr ,  string object )
{
     BST_Node   * =   new   BST_Node ;

     int  last  =  object . find ( " " ,   0 );

    p -> lastname  =  object . substr ( 0 ,  last );


     int  first  =  object . find ( " " ,  last  +   1 );

    p -> firstname  =  object . substr ( last  +   1 ,  first  -  last );

    p -> phone_number  =  object . substr ( object . length ()   -   8 ,   8 );
    p -> address  =  object . substr ( first  +   1 ,  object . length ()   -   9   -  first );

    
         if   ( loc_ptr  ==   0 )
         {
            loc_ptr  =   new   BST_Node ;
            loc_ptr -> lchild  =  loc_ptr -> rchild  =   0 ;
            loc_ptr -> lastname  =  p -> lastname ;
            loc_ptr -> firstname  =  p -> firstname ;
            loc_ptr -> address  =  p -> address ;
            loc_ptr -> phone_number  =  p -> phone_number ;
         }
         else   if   ( loc_ptr -> lastname  >  object )
             Insert_Aux ( loc_ptr -> lchild ,  object );
         else   if   ( loc_ptr -> lastname  <  object )
             Insert_Aux ( loc_ptr -> rchild ,  object );
         else
            cout  <<   "the object is already in the tree\n" ;
    
};
/*Function Name:Update(const string & s)
Precondition: A string gets passed in and a new node is created
Postcondition: function calls update_Aux
Description: string gets chopped into pieces by last name, first name and phone number. function uses
indirect recursion*/
void   Clients_Info_BST :: Update ( const  string  &  s )
{  
     Update_Aux ( root ,  s );
};
/*Function Name:Update_Aux(BST_Node * & loc_ptr, string s)
Precondition: A string gets passed in and a new node is created
Postcondition: function calls update_Aux
Description: string gets chopped into pieces by last name, first name and phone number. function uses
indirect recursion*/
void   Clients_Info_BST :: Update_Aux ( BST_Node   *   &  loc_ptr ,  string s )
{
         BST_Node   * =   new   BST_Node ;
         int  val  =  s . find ( " " ,   0 );
        
        p -> value   =  s . substr ( 0 ,  val );
    
         int  newlast  =  s . find ( " " ,  val  +   1 );
        p -> NewLastName   =  s . substr ( val  +   1 ,  newlast  -  val );

         int  newfirst  =  s . find ( " " ,  newlast  +   1 );
        p -> NewFirstName   =  s . substr ( newlast  +   1 ,  newfirst  -  newlast );

         int  last  =  s . find ( " " ,  newfirst  +   1 );
        p -> lastname  =  s . substr ( newfirst  +   1 ,  last  -  newfirst );

         int  first  =  s . find ( " " ,  last  +   1 );
        p -> firstname  =  s . substr ( first  +   1 ,  first  -  last );

        p -> phone_number  =  s . substr ( s . length ()   -   8 ,   8 );
        p -> address  =  s . substr ( first  +   1 ,  s . length ()   -   9   -  first );

         if   ( p -> value   ==   "1" )
         {
            loc_ptr -> lastname  =  p -> NewLastName ;
            loc_ptr -> firstname  =  p -> NewFirstName ;
            loc_ptr -> address  =  p -> address ;
            loc_ptr -> phone_number  =  p -> phone_number ;

         }
         if   ( p -> value   ==   "2" )
         {
            loc_ptr -> lastname  =  p -> NewLastName ;
            loc_ptr -> firstname  =  p -> NewFirstName ;
            loc_ptr -> address  =  p -> address ;
         }

         if   ( p -> value   ==   "3" )
         {
            loc_ptr -> address  =  p -> address ;
            loc_ptr -> phone_number  =  p -> phone_number ;
         }
         if   ( p -> value   ==   "4" )
         {
            loc_ptr -> lastname  =  p -> NewLastName ;
            loc_ptr -> firstname  =  p -> NewFirstName ;
            loc_ptr -> phone_number  =  p -> phone_number ;
         }
         if   ( p -> value   ==   "5" )
         {
            loc_ptr -> lastname  =  p -> NewLastName ;
            loc_ptr -> firstname  =  p -> NewFirstName ;
         }
         if   ( p -> value   ==   "6" )
         {
            loc_ptr -> address  =  p -> address ;
         }
         if   ( p -> value   ==   "7" )
         {
            loc_ptr -> phone_number  =  p -> phone_number ;

         }

    
}
/*Function Name: BST_Node *Search
Precondition: Searches for client using the string
Postcondition: Search_Aux gets called string gets returned
Description: function does indirect recursion*/
BST_Node   *   Clients_Info_BST :: Search ( const  string  &  s )
{
     return    Search_Aux ( root ,  s );
}
/*Function Name: BST_Node *Search
Precondition: Searches for client using the string
Postcondition: Search_Aux calls itself and if the string is found
it gets returned.
Description: function does direct recursion*/
BST_Node   *   Clients_Info_BST :: Search_Aux ( BST_Node   *  loc_ptr ,  string s )
{

     BST_Node   * =   new   BST_Node ;
     int  last  =  s . find ( " " ,   0 );

    p -> lastname  =  s . substr ( 0 ,  last );

     int  first  =  s . find ( " " ,  last  +   1 );

    p -> firstname  =  s . substr ( last  +   1 ,  first  -  last );
        
     if   ( loc_ptr  !=   0 )
     {
         if   ( loc_ptr -> lastname  ==  p -> lastname  &&  loc_ptr -> firstname  ==  p -> firstname  )
         {
            cout  <<   "They are the same"   <<  endl ;

             return  loc_ptr ;
         }
         else   if   ( loc_ptr -> lastname  >  p -> lastname  &&  loc_ptr -> firstname  >  p -> firstname  )
         {
            cout  <<   "You are look at the lchild"   <<  endl ;

             return   Search_Aux ( loc_ptr -> lchild ,  s );
         }  
         else
         {
            cout  <<   "You are looking at the rchild"   <<  endl ;
             return   Search_Aux ( loc_ptr -> rchild ,  s );
         }
     }
     else
     {
         return  loc_ptr ;
     }
}


class   Client_Address_Book
{
public :
     /*
    *Function Name: Clients_Address_Book
    Precondition: state of class has not be initialized
    Postcondition: state has been initialized
    Description: default constructor will read data from input file "Client_Address_data.txt.*/
     Client_Address_Book ()    //default constructor will read data from input file "client_address_data.txt".
{
    fstream fin ;
    fin . open ( "Client_Address_data.txt" );
     while   ( ! fin . eof ())
     {
        string x ;
        getline ( fin ,  x );
         Insert ( x );
     }
};
     /**Function Name: Insert
    Precondition: takes a string
    Postcondition: calls [Hash_Function(s)].Insert(s)
    Description: inserts to s  .*/
     void   Insert ( const  string  &  s ){ hash_table [ Hash_Function ( s )]. Insert ( s );   };
     /*Function Name: Remove
    Precondition: takes a string
    Postcondition: removes from the hash table
    Description: removes from the hash table.*/
     void   Remove ( const  string  &  s ){ hash_table [ Hash_Function ( s )]. Remove ( s );   };
     /*Function Name: Update
    Precondition: takes a string
    Postcondition: Starts from hash_table[0] and the string gets updated
    Description: updates from index 0 using the string that is passed in.*/
     void   Update ( const  string  &  s )
     {
         BST_Node   * =   new   BST_Node ;

         int  val  =  s . find ( " " ,   0 );
        p -> value   =  s . substr ( 0 ,  val );
    
         int  newfirst  =  s . find ( " " ,  val  +   1 );
        p -> NewFirstName   =  s . substr ( val  +   1 ,  newfirst  -   1 );

         int  newlast  =  s . find ( " " ,  newfirst  +   1 );
        p -> NewLastName   =  s . substr ( newlast  +   1 ,  newlast  -  newfirst );

         int  first  =  s . find ( " " ,  newlast  +   1 );
        p -> firstname  =  s . substr ( newfirst  +   1 ,  first  -  newlast );

         int  last  =  s . find ( " " ,  first  +   1 );
        p -> lastname  =  s . substr ( first  +   1 ,  last  -  first );

        p -> phone_number  =  s . substr ( s . length ()   -   8 ,   8 );
        p -> address  =  s . substr ( first  +   1 ,  s . length ()   -   9   -  first );
        
        cout  <<  p -> NewFirstName   <<  endl ;
        cout  << p -> NewLastName   <<  endl ;

         if   ( p -> value   ==   "3"   ||  p -> value   ==   "6"   ||  p -> value   ==   "7" )
         {
            hash_table [ Hash_Function ( s )]. Update ( s );

         }

     };
     /*Function Name: Print_BST
    Precondition: takes a string
    Postcondition: Starts from hash_table[Hash_Function(s)] and calls the print function
    Description: prints from index 0 using the string that is passed in.*/
     void   Print_BST ( const  string  &  s ){ hash_table [ Hash_Function ( s )]. Print ();   };
     /*Function Name: Print_Hash_Table
    Precondition: function gets called
    Postcondition: The whole hash_table is printed to the screen
    Description: prints the entire hash table.*/
     void   Print_Hash_Table (){   for   ( int  i  =   1 ;  i  <   27 ;  i ++ )  hash_table [ i ]. Print ();   };
     /*Function Name: Print_Hash_Table_to_File
    Precondition: function gets called with a string
    Postcondition: function will print hash table to  output file "sorted_client_address_bk.txt"
    Description: prints hash table to sorted text file.*/
     void   Print_Hash_Table_to_File ( const  string  &  filename ){   "Inside Client_Address_Book Print_Hash_Table\n" ;  
    fstream fout ;
    fout . open ( "sort_client_data.txt" );
    fout  <<   "hello"   <<  endl ;
     }; //function will print hash table to  output file "    
     //sort_client_data.txt ".

     BST_Node   *   Search ( const  string  &  s ){   "Inside Client_Address_Book Search\n" ;   return   0 ;   };
     /*Function Name: Hash_Function
    Precondition: function takes a argument of a string
    Postcondition: number gets returned
    Description: a postive number is returned when the function gets invoked .*/
     unsigned   int   Hash_Function ( const  string  &  s )
     {   "Inside Client_Address_Book Hash_Function\n" ;
     char  p  =  s [ 0 ];
     return  p  -   65 ;  
     };

private :
     Clients_Info_BST    hash_table [ 27 ];   //or 26 or whatever you like
};

int  main ()
{
     Client_Address_Book   My_Book ;
     My_Book . Insert ( "Lofton Bullard 777 Glades Road 207-2780" );
     //My_Book.Remove("Bullard Lofton");
     My_Book . Update ( "1 James Clark Lofton Bullard 777 Glades Run 527-6623" );
     My_Book . Print_BST ( "J" );
     My_Book . Print_Hash_Table ();

     return   0 ;
}

sort_client_data.txt

cop3530_summer_2015_Program7_Hash_BST.htm

COP 3530 Data Structures Summer 2015 ---- Assignment 7

Hashing & BST

Total Points: 100 points

 

Due Date: 7/29/2015 at 10:00PM

NO LATE ASSIGNMENTS WILL BE ACCEPTED!

Name the program for this assignment "hashing_bst.cpp." This assignment is very similar to Assignment#6, accept you will be using a BST to handle collisions.  As before, in this assignment you will write a program that maintains the names (first and last names), addresses and phone numbers in an address book by using a hash table. Use the data file called "client_address_data.txt" to help you create the hash table.  Also, you should be able to enter, delete, modify (names, addresses and phone numbers), or search the data stored in hash table based on the name. A client’s first and last names should be the search key. Once the program is finish execution, the information should be ordered by last name and first name and printed to a file called "sortbst_client_data.txt."

Design a class to represent the hash table. Call this class "Client_Address_Book". "Client_Address_Book" contains all the information for each client (first name, last name, address, and phone number).  Use a linear function (eg. h(last name)=[ascii char value of first letter of lastname]-64) to determine the location of a key in the hash table.  Each cell in the hash table will be a BST.  For example, you will have a BST for last names that begin with 'A', there will be one for last names that begin with 'B', and so forth.  The BST will also be used to handle collisions (clients with the same name) within "Client_Address_Book".  Each BST will maintain the address book in alphabetical order.

When the clients address book is printed, the BST of all the clients’ information stored in the hash table should be printed in order according to the last and first names.  The information should be printed out in the following order: last name, first name, address, and phone number.  Also, include column titles.

 

Declare and implement the following classes: BST_Node, Clients_Info_BST, and Clients_Address_Book.  Store the declaration and implement files in one file call hashing_BST.cpp. You should submit hashing_BST.cpp to blackboard before due date and time.

 

 

Good Luck.... " .

Consider the following skeleton as a hint to help you:

#include <iostream>

#include <string>

using namespace std;

 

class BST_Node  //node in a BST

{

  public:

    string lastname, firstname, address, phone_number;

    BST_Node  *lchild, *rchild;   //left and right children pointers

};

 

class Clients_Info_BST //Binary Search Tree

{

   public:

            Clients_Info_BST(){};//store the data in the hash table

           //Clients_Info_BST(const Clients_Info_BST &);//Copy Constructor

            ~Clients_Info_BST(){};//destructor           

           //void Insert(const string & s){cout<<"   Inside Client_Info_BST Insert\n";};

           //  void Remove(const string & s){cout<<"   Inside Client_Info_BST Remove\n";};

           //  void Update(const string & s){cout<<"   Inside Client_Info_BST Update\n";};

           //  void Print( ){cout<<"   Inside Client_Info_BST Print\n";};

           //  BST_Node * Search(const string & s){cout<<"   Inside Client_Info_BST Search\n"; return 0;};

            

//other member functions you may need.

    private:

       BST_Node *front; //---state information

};

class Client_Address_Book

{

    public:

            Client_Address_Book(){};//default constructor will read data from input file "client_address_data.txt".

            //Client_Address_Book(const Client_Address_Book &);//Copy Constructor

            // void Insert(const string & s);// insert record

            // void Remove(const string & s);//remove record

           //  void Update(const string & s);//update record

            // void Print_BST(const string & s);//ornt

            // void Print_Hash_Table(){"Inside Client_Address_Book Print_Hash_Table\n";};

            // void Print_Hash_Table_to_File(const string & filename);///function will print hash table to output file                                                                                                                                                                                

            // BST_Node * Search(const string & s){"Inside Client_Address_Book Search\n"; return 0;};

            // unsigned int Hash_Function(const string & s);

 

     // Hint:  Remember that the insert, remove and search function for Clients_Address_Book will use //      

    //Client_Info_BST’s insert, remove and search respectively.

    

  private:

     Clients_Info_BST   hash_table[27]; //or 26 or whatever you like

};

int main()

{

            Client_Address_Book My_Book;

            //My_Book.Insert("Bullard Lofton 777 Glades Road 207-2780");

            //My_Book.Remove("Bullard Lofton");

 

/*******************************************************************************

Notes for Update Function:

 

     1.  My_Book_Insert(“1 James Clark Lofton Bullard 777 Glades Run 527-6623”);

            If first character is a 1, this means all three fields will be changed.

      2.   My_Book_Insert(“2 James Clark Lofton Bullard 777 Glades Run”);

            If first character is a 2, this means the Name and Address fields will be changed.

      3.   My_Book_Insert(“3 James Clark 777 Glades Run 555-6666”);

            If first character is a 3, this means the Address and Phone Number fields will be changed.

      4.   My_Book_Insert(“4 James Clark Lofton Bullard 555-6666”);

            If first character is a 4, this means the Name and Phone Number fields will be changed.

      5.   My_Book_Insert(“5 James Clark Lofton Bullard”);

            If first character is a 5, this means the Name field will be changed.

      6.   My_Book_Insert(“6 James Clark 777 Glades Run”);

            If first character is a 6, this means the Address field will be changed.

      7.   My_Book_Insert(“7 James Clark 555-6666”);

            If first character is a 7, this means the Phone Number field will be changed.

 

********************************************************************************/

            //My_Book.Update("1 Bullard Lofton  Comb Harry 555 Palmetto Park Road 555-3444");

            //My_Book.Print_BST("B");

            //My_Book.Print_Hash_Table();

 

            //Client_Address_Book Your_Book = My_Book; //Invoke the copy constructor

            //Your_Book.Print_Hash_Table();

            return 0;

}