Skip to content

Commit

Permalink
Update Dictionary.h
Browse files Browse the repository at this point in the history
  • Loading branch information
KeeganMartin authored Feb 25, 2021
1 parent dd36c25 commit bf33a85
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ class Dictionary
public:
void set(T key, U val)
{
for (int i = 0; i < KeyList.size(); i++)
{
if (KeyList.get(i) == key) {
ValList.set(i, val);
return;
}
}
KeyList.add(key);
ValList.add(val);
}
Expand All @@ -25,7 +32,7 @@ class Dictionary
}
}

T keyOf(U val)
T getKey(U val)
{
for (int i = 0; i < ValList.size(); i++)
{
Expand All @@ -40,4 +47,4 @@ class Dictionary
{
return KeyList.size();
}
};
};

0 comments on commit bf33a85

Please # to comment.