c++, data structure
Write a solution to test 2 problem 3 that uses selectionsort to sort the items in the vector of integers.
#include <iostream>
#include <iterator>
#include <string>
#include <random>
using namespace std;
void insertionSort(int a[], int N)
{
int sorted = 0;
for (int sorted = 0; sorted < N – 1;++sorted)
{
int item_position = sorted +1;
int item = a[item_position];
while (item_position > 0&& a[item_position – 1] > item)
{
a[item_position]= a[item_position – 1];
–item_position;
copy(a, a + N,ostream_iterator<int>(cout, ” “)); cout << endl;
}
a[item_position] = item;
copy(a, a + N,ostream_iterator<int>(cout,
OR
OR