Hashing and bst

Assignment Help Computer Network Security
Reference no: EM13819825

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

{

};

Reference no: EM13819825

Questions Cloud

What business law may look like twenty years from now : Anticipate what business law may look like 20 years from now and what students will need to know in order to be successful in the field. Explain your rationale.
About java program : java program
A transformer with 800 turns on the primary coil : A transformer with 800 turns on the primary coil is used to decrease the voltage from 2000 V to 120 V for home use. How many turns should be in the secondary coil?
How much current does the battery supply to the circuit : In a 12-V battery circuit, a 10-Ohm resistor and a 30-Ohm resistor are connected in series. How much current does the battery supply to the circuit?
Hashing and bst : Hashing and BST
Explain your rationale for selecting the five that you did : Explain your rationale for selecting the five that you did. Next, discuss how you will apply the one or two most important lessons learned from this class in your current (or future) career.
Explain two way financial systems had an impact in your life : Explain at least two ways financial systems and markets have had an impact in your life in the past or may impact you in the future.
Define diversification and necessity in risk management : HowRu, a private card business and its subsidiary, have a 14% share of the greeting card market. The card business is subject to seasonal cycles, with sales being highest during the holiday season. For this assignment, please complete the followin..
Identify two strategies that your current employer use : Identify at least two strategies that your current or past employer uses in order to protect the civil rights and liberties of its workers. Provide a rationale for your response.

Reviews

Write a Review

Computer Network Security Questions & Answers

  Define attack methodology and countermeasures

Attack Methodology and Countermeasures, Imagine that a local company has hired you as a penetration tester to perform necessary testing. The company has asked you to report back to the Board of Directors on your findings.

  Describe the environment of your forensic workstation

Describe the environment of your forensic workstation and the access to the machine. Describe the procedure that you used to download the image file to your work directory.

  What is the decrypted plaintext

A 1,024-bit message is used to generate a 24-bit hash. On the average, how many other messages could be expected to generate the same hash value? What is the probability that two massages that generate the same 24-bit hash?

  How asymmetric cryptography is used to provide encryption

Briefly compare and contrast how asymmetric cryptography is used to provide encryption as opposed to how it can be used to provide a digital signature.

  How many bits is the encrypted message

Based on the understanding of Q4 of Bart B, use the generated keys of Q2 - Part C to encrypt the message of Q1 - Part C using the Simplified DES algorithm.

  Cybersecurity research paper

Identifying and explaining how the breach occurred and identifying and discussing known or suspected losses of confidentiality, integrity, and availability for information and/or information systems

  Define the principle of defense in depth

Define the principle of defense in depth. Give two examples of how the principle might be applied: one describing security measures across multiple layers of security architecture, and another describing security measures within a single layer

  Report of network security

Report of network security solutions around 3 to 4 pages . Example and reasons for evertything thats needed for the sercurity.

  Discuss the steps necessary to make electronic evidence

Identify and discuss the steps necessary to make electronic evidence admissible in court and identify various crimes and incidents that are involved in electronic forensic investigations.

  Apply division method to calculate hash value of character

How can we apply division method to calculate hash value of character string without using more than constant number of words of storage outside string itself?

  Assignment on securing the scene

Imagine you are a digital forensic investigator for a healthcare organization. You learn from your internal information security department that an employee has been using password-cracking software to access confidential customer insurance inform..

  Using cbc mode of operation what are consequences

Using CBC mode of operation what are the consequences of decrypting the cipher text if it has an error in the first bit of the first block C?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd