I've got an array BM[] with a length of 5. How would I declare my function in the heading and what am I doing wrong in my code, it keep giving me errors. Also I dont know how to apply it to my program to do the sorting. Like would I write cout<<insertionSort(BM[])<<endl;
I need help, I'm kinda new to C++
insertionSort(array BM[])
for i = 1 to length[BM]-1 do
{
value = BM[i]
j = i-1
while (j >= 0 && BM[j] > value)
{
BM[j + 1] = BM[j]
j = j-1
}
BM[j+1] = value
}