Removing the ith element from array so the time complexity does not depend on array size
<p>Yesterday I have took my Analysis of Algorithm exam in which the question was
 <strong><em>Describe how one can implement each of the following operations on an array so that the time it takes does not depend on the array size n.</em></strong></p>

<ul>
<li><p>Delete the ith element of an array of size n.</p></li>
<li><p>Delete the ith element of a sorted array, where the array remains in
sorted order after the deletion.</p></li>
</ul>

<p>For the first part we can swap the ith value with the last one , thats what I wrote, while doing this for the sorted array will not work because array will get unsorted. 
Now the question are, how one can implement this for sorted array? Is it possible to do this without any drawbacks? Can we do it in better way for unsorted array?</p>