[prev] [index] [next]

Exercise: Insert/Delete in Sorted Array

Implement the above insert and delete operations:

// insert value v into array a of length n

void insert(int *a, int *n, int v);

// delete value v from array a of length n

void delete(int *a, int *n, int v);

What special cases do we need to consider?