Originally Posted by
rcgldr
The main difference is that an insertion sort is usually performed on an existing array, starting at the beginning of the array. In this case, you're inputting data one character at a time, so the array is growing as you insert each character, and the array is always in a sorted state, which means you could optionally use a binary search to speed up location of the insertion point, but that wouldn't be needed for this class. It would also be possible to use other sort methods, such as a bottom up merge sort, but again, beyond what is appropriate for your class.