3 ms·
Should have mentioned that temporaries are allowed. Also you swapped the array elements twice... The terminating condition should be x == y. Also if you change
by pkaye 9y ago
Should have mentioned that temporaries are allowed. Also you swapped the array elements twice... The terminating condition should be x == y.
Also if you changed this to a int *a (and a count), some people will get confused how to do this all with pointers. Asking how this would be tested is also a good question.