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

Project Part 2- Info Security & Risk Mgmt (ISOL-533) - Medical terminology f health w mymed - Anthropologist who gave the definition of religion in the module - Write pseudocode for strassen's algorithm - Hope was here pdf - Example of stimulus generalization in marketing - Customer a with a bronze service level package calls - Discussion Reponses (#2) - Does depth strider affect swimming - A foolish stag meaning in urdu - Mental health and disabilities - Cat 320e lifting chart - Virginia henderson principles and practice of nursing - Reebok nfl replica jerseys a case for postponement solution - Week 3 Discussion - Podcast: Three Miles, This American Life - Joseph's Group - Case study - International Letter - Cengage Quiz Due Today by 11:00 pm. - Prog & promotions in rec park - Bbc bitesize solids liquids and gases - Medicare levy exemption or reductio - Mod DQ 1 Response NI - Equal employment opportunity in hrm ppt - 90 lakeshore drive north avoca - The girl who could fly victoria forester - Clinical Supervision - The computer revolution and the problem of global ethics - Token economy parenting - Informative research paper - Chapter 11 lesson 3 lifelong nutrition answers - Week 6 Reflection - Art. project 4 - What is the competitive advantage of smoothie king - English - Unit 2 Discussions (BUS411 & HRM303) - Southwood school case study analysis - Friedland libra+ additional portable chime d917 - I yearn for true gender equality japanese copypasta - 1 - The dynaco manufacturing company produces - Bang on brows applecross - Sas 9.4 export to excel - Financial information is presented below operating expenses 28000 - 2 pages - Reidbar to metric coupler - Multimedia statement of intent - How to calculate pvif - Destination filename startup-config packet tracer - List of forensic databases - Bsbldr502 lead and manage effective workplace relationships pdf - Response paper - Animal farm essay plan - Mirror ray diagram worksheet answers - Multiple step income statements show - Sat practice test 10 answer sheet - Math about me project - Ib physics exam 2016 - Objectivism subjectivism and relativism in ethics - Synthesis of research on homework - War on people with low average intelligence - Module 11 Written Assignment - Best Practice - Mba quaid e azam university - Nemo nisi mors marc jacobs bracelet - Opposite each general audit procedure write the management assertions - WK4 Assignment-Quantitative Research Critique - Determinants of group behaviour ppt - Symbolism in hands by sherwood anderson - A view from the bridge conflict essay - Sed regex cheat sheet - A mi hermanito le dolía la con frecuencia. - Solitaire company's fixed budget performance report for june follows - Thursford christmas show 2016 - Spanish language book publishers - Justified wages case solution - Chapter 8 audit planning and analytical procedures solutions - Discussion Post- Due today 11:00pm ET - Strengths Report - Rover control r1 java program - Product life cycle theory of international trade ppt - Managerial accounting - Association of bookmobile and outreach services - L oreal marketing case study - Adding ed and ing worksheets pdf - Ya estas - Can a pmo accelerate the implementation process discussion - Standardization of sodium hydroxide solution with khp - Glulam portal frame detail - Managing organizational change a multiple perspectives approach 2nd edition - Countable and uncountable sets in discrete mathematics - Advertising Assignment I - The Importance of Marketable Objectives - Copper sheet thickness tolerance - Mtv networks the arabian challenge - Math 101 - Golden boy tara sullivan sparknotes - Blaauwberg nature reserve cape town - Crafting and executing strategy mcgraw hill - Tarantella a doll's house - Assignment: Analysis of a Pertinent Healthcare Issue - Analyze Your Customers