Question: I need help defining a class in C++ that acts like a python dictionary. I need to be able to add keys-values to an already

I need help defining a class in C++ that acts like a python dictionary. I need to be able to add keys-values to an already existing dictionary. For example

id= {'sam':75, 'robert':09907, 'timmmy',95453, 'samuel',5333)}.

i want to create a class in which i can do

id.add("samuel', 8439922) and it adds it to the dictionary. i want to implement this with using vectors to store the pairs.

I need to do this without using any features like maps, every thing has to be made from scratch.

edit: does not need to be generic, can be with strings and ints

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!