void deleteRange( int from, int to) {int i, j = 0;for (i = 0; i < counter;="" i++)="">if (i <= from="" -="" 1="" ||="" i="">= to + 1) {A[j] = A[i];j++;}}for (int i = 0; i < j;="">cout < a[i]="">< "="">}
Above method deletes range of elements from an array. Consider array A[] globally declared and counter is its size. Please explain the logic of above code in simple english (algorithm and comments).
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here