Question
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.
______________________________________________________________________________________________________________
//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
{
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 recordsStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started