Help removing one line of code from output!
Hello I am trying to have my output not write the first line of code, it's the reason my project keeps failing. I was thinking about a if statement?
http://imgur.com/a/3Gs2u
Here is my code
void InsertionSort(int array[], int len){
for (int i = 0; i < len; i++){
int j = i;
while(j > 0 && array[j] < array[j - 1]){
int buffer = array[j];
array[j] = array[j - 1];
array[j - 1] = buffer;
j--;
}
for(int i = 0; i<len; i++)
cout<<array[i]<< " ";
cout<<"\n";
}
}
Topic archived. No new replies allowed.