Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Dictionary using hashing c++ program

28/03/2021 Client: saad24vbs Deadline: 2 Day

Source/Assg13/assg-13.cpp
Source/Assg13/assg-13.cpp
/**
*
*
* @description Assignment 13 Dictionaries and Hash table
* implementations.
*/
#include < cassert >
#include < iostream >
#include "KeyValuePair.hpp"
#include "Employee.hpp"
#include "HashDictionary.hpp"

using namespace std ;

/** main
* The main entry point for this program. Execution of this program
* will begin with this main function.
*
* @param argc The command line argument count which is the number of
* command line arguments provided by user when they started
* the program.
* @param argv The command line arguments, an array of character
* arrays.
*
* @returns An int value indicating program exit status. Usually 0
* is returned to indicate normal exit and a non-zero value
* is returned to indicate an error condition.
*/
int main ( int argc , char ** argv )
{
// -----------------------------------------------------------------------
cout << "----- testing Employee record and KeyValuePair class -----------" << endl ;
KeyValuePair < int , string > pair ( 42 , "blue" );
cout << "test key: " << pair . key () << endl ;
assert ( pair . key () == 42 );
cout << "test value: " << pair . value () << endl ;
assert ( pair . value () == "blue" );

int id = 3 ;
Employee e ( id , "Derek Harter" , "1234 Main Street, Commerce TX" , 12345.67 );
cout << e << endl ;
assert ( e . getId () == 3 );
assert ( e . getName () == "Derek Harter" );
cout << endl ;


// -----------------------------------------------------------------------
cout << "-------------- testing quadratic probing -----------------------" << endl ;
const int TABLE_SIZE = 7 ;
HashDictionary < int , Employee > dict ( TABLE_SIZE , EMPTY_EMPLOYEE_ID );

cout << "Newly created hash dictionary should be empty, size: " << dict . size () << endl ;
assert ( dict . size () == 0 );

int probeIndex = 0 ;
//cout << "probe index: " << probeIndex
// << " returned probe value: " << dict.probe(id, probeIndex)
// << endl;
//assert(dict.probe(id, probeIndex) == 2);

probeIndex = 1 ;
//cout << "probe index: " << probeIndex
// << " returned probe value: " << dict.probe(id, probeIndex)
// << endl;
//assert(dict.probe(id, probeIndex) == 5);

probeIndex = 5 ;
//cout << "probe index: " << probeIndex
// << " returned probe value: " << dict.probe(id, probeIndex)
// << endl;
//assert(dict.probe(id, probeIndex) == 37);
cout << endl ;

// -----------------------------------------------------------------------
cout << "-------------- testing mid-square hashing ----------------------" << endl ;
// the following asserts will only work for 32 bit ints, leave asserts
// commented out if you have 64 bit asserts
cout << "Assuming 32 bit (4 byte) ints for these tests: " << sizeof ( int ) << endl ;
assert ( sizeof ( int ) == 4 );

//id = 3918;
//cout << "hash key: " << id
// << " returned hash value: " << dict.hash(id)
// << endl;
//assert(dict.hash(id) == 1);

//id = 48517;
//cout << "hash key: " << id
// << " returned hash value: " << dict.hash(id)
// << endl;
//assert(dict.hash(id) == 6);

//id = 913478;
//cout << "hash key: " << id
// << " returned hash value: " << dict.hash(id)
// << endl;
//assert(dict.hash(id) == 5);

//id = 8372915;
//cout << "hash key: " << id
// << " returned hash value: " << dict.hash(id)
// << endl;
//assert(dict.hash(id) == 4);

// test that the distribution of the hash values
// over the possible slots/buckets looks relatively
// evenly distributed
int counts [ TABLE_SIZE ] = { 0 };
//for (id = 0; id < 1000000; id++)
//{
// int hash = dict.hash(id);
// counts[hash]++;
//}

// display results
int sum = 0 ;
for ( int slot = 0 ; slot < TABLE_SIZE ; slot ++ )
{
cout << "counts for slot[" << slot << "] = "
<< counts [ slot ] << endl ;
sum = sum + counts [ slot ];
}
// spot check results
//assert(sum == 1000000);
//assert(counts[0] == 143055);
//assert(counts[6] == 142520);

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Engineering Guru
Maths Master
Fatimah Syeda
Top Class Engineers
High Quality Assignments
Online Assignment Help
Writer Writer Name Offer Chat
Engineering Guru

ONLINE

Engineering Guru

I will cover all the points which you have mentioned in your project details.

$61 Chat With Writer
Maths Master

ONLINE

Maths Master

I will cover all the points which you have mentioned in your project details.

$20 Chat With Writer
Fatimah Syeda

ONLINE

Fatimah Syeda

I will cover all the points which you have mentioned in your project details.

$19 Chat With Writer
Top Class Engineers

ONLINE

Top Class Engineers

You can award me any time as I am ready to start your project curiously. Waiting for your positive response. Thank you!

$25 Chat With Writer
High Quality Assignments

ONLINE

High Quality Assignments

You can award me any time as I am ready to start your project curiously. Waiting for your positive response. Thank you!

$52 Chat With Writer
Online Assignment Help

ONLINE

Online Assignment Help

Give me a chance, i will do this with my best efforts

$64 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

The level of various substances in the blood - Staying on course to your success - Agreed upon procedures representation letter - Ex16_xl_ch04_grader_cap_as mountain view realty 1.6 - Understanding arguments an introduction to informal logic 9th edition pdf - Quicken social security optimizer promotional code - Need done ASAP - What is cost of goods purchased - Research paper 12 pages and 12 ppt slides subject topic INTUIT - Four types of application software - Sudhin shahani net worth - Habitual decision-making is characterised by: - Tough guise 2 violence manhood & american culture - Passive and active resistance to slavery die casting design considerations - Case Study - Ecf meaning mark scheme - Discussion Prompt - HCA/370Organizational Behavior - Separation of the components of a mixture lab report answers - Elements of contemporary arts appropriation - Ego Integrity Presentation - Kohlberg’s Stages of Moral Development - What is power in statistics - Types of analogies list - Health clearance provided no action required - Religion religions religious smith - Vulnerability Assessment - Attached format needs to be used for this assignment. Guidance is listed in the question. - 10 days in europe game - Essay - Crestron dm md6x4 price - Liquid kelp home depot - Imagined geographies - Drink more water persuasive speech - Week 7 summary - Week 10 - Ringway control and automation - 2 dollar movie theater in bartlett - Analysis of commercial bleach lab report - Unit 6 wow pet battle - How does growth on the unopened plates affect the reliability - Moodle login fed uni - History exam - Mcdonald & hagen wealth management - Steiner and steiner business government and society - Pros and cons of code of ethics - Standard assignment 3 analysis - History_ Assign - Ingenico ict220 reprint receipt - Hose pro international brookvale - Form PICOT question - NEED ASAP, PSYCH SEMINAR - Laboratory do's and don ts worksheet answer key - I thank you god for most this amazing - A credit sale is made on july 10 for $900 - Chapter 5 socializing the individual review worksheet answers - Open market operations rba - Heaps and prority queus In python - Writers such as shakespeare and marlowe focused on - Mod b practice questions - Introduction post on Global Mkt & Blockchain Tech - Week 7 discussion eco - Factor tree of 40 - Lab 7: Intellectual Property - Help - Capital budgeting practice problems and solutions - Excel chapter 4 grader project 2018 - Pest control licence course qld - Gelds 48-60 - Why study the past - Blowout and non blowout pipette - Taxation exam - Tom brady should probably not mow his own lawn because - Naeyc position statement responding to linguistic and cultural diversity - Philosophy here and now 3rd edition - Silver carbonate on heating gives - List of middle range nursing theories - Cross site scripting xss attack lab elgg - Abigail adams urges husband to remember the ladies - Q2.30. what is the estimated ecosystem respiration (re) for the stream? - Applied corporate finance a user's manual - Oratane pills price at dischem - Summary of the great debaters movie - Housing nsw rent subsidy form - Memorial hospital case study operations management - Psy - I posted earlier but did not respond because I thought i would be able to complete it. I am unable to get done by midnight pacific time. Can someone please help and get this done by midinight today? - Donabate portrane tennis club - Mundane realism definition psychology - Chipotle vision statement - MBA work 2 - Number system conversion with solution - Qxd = 14 - (1/2)px and qxs = (1/4)px - 1 - Warnerwoods company - Applications of digital electronics ppt - Scylla and charybdis odyssey - Taxi kingston ri train station - Are you looking for someone to take your online macroeconomics class? - Integrated internet marketing communication - Multi linked list program in c - Winfield refuse management inc case solution