Question: In c + + please help me complete this dict.h #pragma once #include #include #include #include treeClass.hpp #include pair.hpp template class Dictionary {

In c++ please help me complete this
dict.h
#pragma once
#include
#include
#include
#include "treeClass.hpp"
#include "pair.hpp"
template
class Dictionary {
private:
Tree> dictTree;
public:
Dictionary()= default;
bool empty(){
return dictTree.isEmpty();
}
size_t size(){
return dictTree.size();
}
ValueType& get(KeyType key)
{
}
void set(KeyType key, ValueType value){
Pair thePair = MakePair(key, value);
bool inTree = dictTree(thePair, thePair);
if (inTree){
return thePair.second;
}
else {
throw std::out_of_range("Item does not exist in Dictionary");
}
}
void insert(KeyType key, ValueType value){
BST b;
Pair newEntry = MakePair(key, value);
dictTree.insert(newEntry);
b.Insert(key, value);
}
list getKeys(){
list listKey;
return listKey;
}
list getValues()
{
list listValue;
return listValue;
}
ValueType& at(const KeyType item){
ValueType theValue;
Pair thePair = MakePair(item, theValue);
bool inTree = dictTree(thePair, thePair);
if (inTree){
return thePair.second;
}
else {
throw std::out_of_range("Item does not exist in Dictionary");
}
}
ValueType& operator[](const KeyType& key){
return at(key);
}
ValueType& operator[](const KeyType item){
return at(item);
}
};
pair.hpp
#pragma once
template
class Pair {
public:
KeyType first;
ValueType second;
Pair()= delete;
Pair(KeyType x, ValueType y) : first(x), second(y){}
bool operator(const Pair rhs) const {
bool meetsCriteria = false;
if (this->first rhs.first){
meetsCriteria = true;
}
return meetsCriteria;
}
bool operator>(const Pair rhs) const {
bool meetsCriteria = false;
if (this->first > rhs.first){
meetsCriteria = true;
}
return meetsCriteria;
}
bool operator==(const Pair rhs) const {
bool meetsCriteria = false;
if (this->first == rhs.first){
meetsCriteria = true;
}
return meetsCriteria;
}
};
template
Pair& MakePair(KeyType first, ValueType second){
Pair* newPair = new Pair(first, second);
return *newPair;
}
template
class Pear
{
public:
T1 key;
T2 value;
};
 In c++ please help me complete this dict.h #pragma once #include

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!