Question: solve in c++ program please i need to copy it from you so please ( type it and put the solution here ) so i

solve in c++ program please
i need to copy it from you so please ( type it and put the solution here ) so i can copy and paste the codes
i need the real codes to copy paste in microsoft world ( dont take a photo for the slution)  solve in c++ program please i need to copy it from
you so please ( type it and put the solution here )

Write a function called small() that takes three arguments: the location of the first element k, the dimension nDim of a vector v, and the vector v itself, the function returns the index of the smallest element in the given vector from the location k to location nDim Write a function called swap that takes two arguments and swap their values. Write a main) program that input the dimension nDim and the elements of the vector, sort the elements of the vector in ascending order, and output the sorted elements. One way to sort the elements of a vector (there are more efficient ways) is to do the following Step 1: use the function small() to find the smallest element (among: X, X2, ..., xn), and use the function swap() to exchange it with the first element of the vector Step 2: use the function small() to find the smallest element (among: X2, Xz, ..., xn), and use the function swap() to exchange it with the second element of the vector Step 3: use the function small() to find the smallest element (among: X3, Xa, ..., xn), and use the function swap() to exchange it with the thircd element of the vector Step n-1: use the function small() to find the smallest element (among: xn1, Xn), and use the function swap() to exchange it with the (n-1)th element of the vector

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!