Array
#
Tips
#
- Don’t discard the option of doing things with more than one pass (possibly two or three passes).
- Don’t worry about integrity of the array (sortedness, keeping equal entries together, etc.) until it is time to return.
- Consider overwriting an entry, possibly by moving an item from the back, instead of deleting an entry and moving all items from its right).
- Learn to manipulate subarrays.
- To avoid off-by-1 error and to make the implementation simple, allocate n+1 sized array for n items.