What you would need to do in that case is shuffle b, c, d, and e over one space, and then mark the array as being one shorter.

This is in general why erasing an element from an array is O(n). Other data structures are better for frequent erasures at arbitrary positions.

Of course, erasing an element from the *end* of an array is O(1), since you only need to reduce the apparent array size by 1.