void InsertionSort(Vector<int> &v)
{
int i,j;
for (i = 1; i < v.size()-1; i++) {
int cur = v[i]; // slide cur down into position to left
for (j=i-1; j >= 0 && v[j] > cur; j--)
v[j+1] = v[j];
v[j+1] = cur;
}
}
int main ()
{
int i=0;
Vector<int> v;
v.add(92);v.add(45);v.add(67);v.add(41);v.add(74);v.add(28);v.add(87);v.add(8);v.add(67);v.add(15);v.add(59);
InsertionSort(v);
for(i=0;i<v.size()-1;i++)
cout<<v.getAt(i)<<endl;
return 0;
}
This code get compiled and run but when I go to debug mode and put v[j+1]or v[j] the I get the error:
CXX0034: Error: types incompatible with operator in the watch window
I also tried to use v[1] or v[0]..etc but the same problem remains there...