Deletion (1)
Problem: Given a (sub)array a[left…right], delete the value in a[del]. If necessary, shift values left to fill the gap. (Assume that left ? del ? right.)
Array deletion algorithm:
To delete the value at index del in a[left…right] (where left ? del ? right):
1. Copy a[del+1…right] into a[del…right–1].2. Make a[right] unoccupied.3. Terminate.