Question: Given a vector , Write a function in C++ that void store(int index,int value) such that value is added to the list in the index

Given a vector >, Write a function in C++ that void store(int index,int value) such that value is added to the list in the index of the vector passed.

void store (int index,int value)

{

vector > A;

// Define rest of function here!

}

For Example

store(1,3)

store(1,5)

store(2,2)

store(2,5)

The list in the1st index of the vector must have values 3 and 5 and the list in the 2nd index of the vector must have values 2 and 5 in the list.

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!