#include <iostream>
using namespace std;
void swap(int *a, int *b)
{
int temp;
temp = *a;
*a = *b;
*b = temp;
}
selectionSort(vector<int> &A) {
int i, j, min;
int n=(int)A.size();
for(i=0;i<n-1;i++){
min=i;
for(j=i+1;j<n;j++){
if(A[min]>A[j])
min=j;
}
swap(A[min],A[i]);
}
}
int main()
{
vector<int> A = {5, 2, 6, 7, 2, 1, 0, 3};
selectionSort(A[]);
int n=(int)A.size();
for(int i=0;i<n;i++){
cout<< A[i]<<endl;
}
return 0;
}
I am trying to run selection sort algorithm but its showing the above mentioned error
error line is selectionSort(vector &A) {
Also what am i suppose to use before selectionSort(vector &A) , void or int?