Write a value called insert that takes this vector v as a


Question- Suppose a vector "v" contains a sequence of integers ordered from lowest to highest.

For case, "v" might contain values 3,6,7,12.

- Write a value called "insert" that takes this vector "v" as a first argument and an integer "k" as the second argument.

The function inserts "k" into the vector so that it preserves the order of elements.

For case, if "v" were (3,6,7,12) and "k" were 8, then after calling the function, "v" would be (3,6,7,8,12).

In your implementation of "insert", does not use the insert function of the vector class (v.insert).

The test code should use assertions.

Please do proper documentation of code.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a value called insert that takes this vector v as a
Reference No:- TGS0966241

Expected delivery within 24 Hours