Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Network & Security Expert

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

#include

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()

{

};

Computer Network & Security, Computer Science

  • Category:- Computer Network & Security
  • Reference No.:- M91389731
  • Price:- $40

Guranteed 36 Hours Delivery, In Price:- $40

Have any Question?


Related Questions in Computer Network & Security

Network requirement analysis and planpurpose of the

Network requirement analysis and plan Purpose of the assessment (with ULO Mapping) Main objective of this assignment is to enable student to understand networking devices, gather requirements for a given business case st ...

Suppose that serendipity bank has excess reserves of 12000

Suppose that Serendipity Bank has excess reserves of $12,000 and check able deposits of $150,000. If the reserve ratio is 20 percent, what is the size of the bank's actual reserves?

A wall street journal article noted that a study by us

A Wall Street Journal article noted that a study by U.S. Congressional Budget Office "estimated raising the minimum wage to $10.10 per hour reduced U.S employment by 500,000 but lift 900,000 Americans out of poverty". Wh ...

Question snmp initially appeared in 1988 but it did not

Question : SNMP initially appeared in 1988, but it did not receive widespread adoption. What have been the issues with SNMP, and have they been addressed? How widely used is SNMP now? Find some examples of tools that use ...

Income effects depend on the income elasticity of demand

Income effects depend on the income elasticity of demand for each good that you buy. If one of the goods you buy has a negative income elasticity, that is, it is an inferior good, what must be true of the income elastici ...

Part auniversity of neverland offers more than 300

Part A University of Neverland offers more than 300 undergraduate programs. The Bachelor of Dreams is one of the highly regarded program offered by the University. The University tries to improve all its programs by intr ...

If a firms total cost function is given byt c

If a firm's total cost function is given byT C= 115,000Q-500Q2+Q3, what range of output does the firm have economies of scale?

Suppose there is no inflation and an insurance company

Suppose there is no inflation and an insurance company offers a contract that would pay $500,000 with certainty 50 years from now. What is the most that this contract would be worth today if: 1. The rate of interest is 7 ...

If a router is attached to a network with a base ip address

If a router is attached to a network with a base IP address of 198.10.0.0/20 and receives a packet addressed to 198.10.10.144, answer the following questions: What is the network mask used by the router? (in dotted decim ...

Case study network design for ezy-booksezy-books is a

Case Study: Network Design for EZY-Books EZY-Books is a specialised publisher for customised book publication services based in Brisbane. The company has recently purchased a two-story building in a Brisbane suburb as it ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As