Question
In C++ void selectionSort(vector &arr) { for(int i = 0; i arr[j]) { swap(arr[i], arr[j]); } } } } int binarySearch(vector arr, int from, int
In C++
void selectionSort(vector
int binarySearch(vector
int mid = (from + to) / 2; if (arr[mid] == value) return mid; else if (arr[mid]
Implement this algorithm in C++ and test its correctness. Write a main() function to a. input a set of numbers from an input file into a vector, b. call and pass the vector to selection sort, and
c.display the sorted numbers.
Use the following input file
D. to prompt the user for a number to search (until ^D) and display the position of the number in the sorted vector. Try your program for the following user input
The output should be:
55050 215-342m
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started