Write Solution Uses Selection Sort Sort Items Vector Integers Note Need Help Write Problem Q37143405

Write a solution that uses selection sort to sort the items inthe vector of integers.

Note: I need help to write out this problem in C++ whileusing Visual Studio 2017

//This code

#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;
       }
      

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.