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

Monster high 13 wishes - Laval produces lamps and home lighting fixtures - Oreo value proposition - International j soc sci & education - Compliance based ethics codes typically - Airbus global market forecast - Amazon sales and operations planning in supply chain integration - Agree or disagree essay examples - According to the activation synthesis theory dreams - A6304 - PAD 540 Week 3 - Moving average forecasting techniques do the following - Final Narrative Paper - Cryptography - Aws double hung windows - Reflection paper on communication class - Which of the following sentences is a prisoner reentry strategy - Traditional income statement managerial accounting - Romeo and juliet paper assignment - Why do organizations still have information deficiency problems - Health finance discussion - Managerial economics markets and the firm 2nd edition pdf - Www ncsbn org 1225 htm - The examined life philosophical meditations pdf - Pestel analysis of singapore tourism industry - Sc1040 week 4 assignment - Whole foods prepared foods job review - Growth strategy of coca cola company - Tuning Data Warehouse - A tale of dark and grimm - Det tronics uv flame detector - Birmingham city university jobs - Cla val cf1 c1 - 750 words A review of two research articles - "Revolutions after the Revolution" - The following are audit procedures from different transaction cycles - Men should weep theatre - Cracking your genetic code movie worksheet - Positive contraction stress test ati - Marketing simulation managing segments and customers - Joint mission planning system - Public mobile to koodo migration offer - A level biology specification - Get rms customer number - Nutrition real people real choices pdf - Apps det wa edu au dest - BMGT 305 - Carbonaro effect broken vase warehouse - Between 1879 and 1880, an estimated 40,000-60,000 african-americans migrated to - 631wk3Assign - Csec 630 final exam - Safe work australia model code of practice - Is color blind recessive or dominant - Http citationmachine net index2 php reqstyleid 2&newstyle 2&stylebox 2 - Does increasing temperature decrease density - Garth owns two all terrain vehicles - Dragon's dogma sovereigns mantle - Hipaa data backup plan - Fergal mcelhatton solicitor belfast - Flysky fs gt3c reverse throttle - Which of the following statements is true of cooperative advertising - Adding fractions butterfly method - Venture capital proposal template - APA Title & Reference Page - Challenger institute of technology rockingham - Planes para el invierno fill in the blanks with informal commands based on the cues. - Older Adults Patient Education Issues Essay and Interview - Explain osmosis in potatoes - Chronicle of Higher Education Assignment - Urgent - 12-16 Hours - International driving permit service nsw - Usmc fire plan sketch - Skeleton pattern in castingbachelor of nutrition la trobe - Week9 health discussion 455 - Web server plugin for websphere application server - Professional Product - Therapy - Dr dilis clare thyroid - Jsp java server pages - Deliverable 2 - Regulatory Presentation - Audi cork used cars - Econometric. Stata. - Ucd medicine entry requirements - The donahey law firm columbus oh - Week 5 socioautobiography audio powerpoint - How to annotate a powerpoint - How to report greenhouse geisser - Excel macro tutorial for beginners - Each kidney contains over 1 million functional units called - A physics student on planet exidor throws a ball - Los estudiantes de la universidad virtual estudian - X 2 1 n reduction formula - Ethical dilemma examples in public administration - Blank usa nickname of a record label headquarter - To determine if the type of agar affects bacterial growth - Damien 1978 movie sequel crossword - Angle of elevation and depression word problems - Ict university tuition fees - East west family health - How to word search in pdf - Public health 101 healthy people healthy populations pdf