Question: Function: swapNext2BigNext2Small Input: 1. (1N double) A Vector of numbers (N>=4) Output: 1. ( 1xN double) A Vector Function Description: - Given a 1XN vector

 Function: swapNext2BigNext2Small Input: 1. (1N double) A Vector of numbers (N>=4)

Function: swapNext2BigNext2Small Input: 1. (1N double) A Vector of numbers (N>=4) Output: 1. ( 1xN double) A Vector Function Description: - Given a 1XN vector where N>=4, return a new vector with the next to largest and next to smallest values swapped Note(s): - All values that are not being swapped should stay in the same location. - There will be no duplicate values in the vector Hint(s): - sort() may be useful - Use of a variable to hold a value may be helpful Examples

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!