Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ program... please program in C++ and include the operations shown in the HashTable class section. Implement a closed hash table data structure, and use

C++ program... please program in C++ and include the operations shown in the HashTable class section.

Implement a closed hash table data structure, and use this hash as the index for rapid searching of a database of

student records.

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

______________________________________________________________________________________________________________

//Slot.h file for guidance, not neccesarily part of program but could be similar

#pragma once

#include

#include

#include

using namespace std;

enum SlotType {normalSlot, emptySlot, tombstone};

template class Slot

{

private:

int key;

T value;

SlotType type;

public:

Slot()

{

key = 0;

type = emptySlot;

}

Slot(int newkey, T newvalue)

: key(newkey), value(newvalue)

{

type = normalSlot;

}

void kill() {

type = tombstone;

}

// Get the integer key of a record

int getKey() const {

return key;

}

// Get the value of a record

T getValue() const {

return value;

}

// Check if a record is empty

bool isEmpty() const {

return(type == emptySlot);

}

// Check if a record is a normal record

bool isNormal() const {

return(type == normalSlot);

}

// Check if a record is a tombstone

bool isTombstone() const {

return (type == tombstone);

}

// Overload the

friend ostream& operator

if (me.isTombstone())

os >";

else if (me.isEmpty())

os >";

else

os

return os;

}

~Slot()

{

}

};

//end Slot.h

Project #4-Hash Table Indexing Learning Objectives Implement a data structure to meet given specifications Design, implement, and use a closed hash table data structure Perform empirical analysis of algorithm performance Use a hash table as an index to a data store Overview Your task for this assignment is to implement a closed hash table data structure, and to use this hash as the index for rapid searching of a database of student records

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

2. How were various roles filled?

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago