Question: This assignment should utilize the vector container of the STL; it should not utilize the algorithms of the STL. Array notation should not be used
This assignment should utilize the vector container of the STL; it should not utilize the algorithms of the STL. Array notation should not be used to acces:s the data. Create a new program, spSearchSortHW.cpp. 1. Write a function, sortVectorViaSelection, which will utilize the selection sort algorithm to arrange the integer values in a vector, the function's single parameter, in ascending order. 2. Write a function, binarySearchOfVector, that will utilize the binary search algorithm to determine where an integer, valueToFind, is located in a vector. The function should have three parameters: the value to find, the vector and a position to hold the index of where the value is found, if it is found. The function should return the true or false to indicate whether the valueToFind was found in the data or not. 3. Include in your program a copy of function displayData, from a previous program, to display the elements of a vector to the screen, one element per line. 4. Include code in function main to thoroughly test these two new functions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
