Algorithm

Insertion Sort

macro 2008. 3. 15. 14:27
반응형
 - 장점
An important virtue of insertion sort, however, is that inserting a single element into a set that is already sorted requires only one scan of the sorted elements, as opposed to a complete run of the algorithm.

- 적용사례
This makes insertion sort efficient for incremental sorting. This situation might occur, for example, in a reservation system of a large hotel. Suppose one display in the system lists all guests, sorted by name, and is updated in real time as new guests check in. Using insertion sort, resorting requires only a single sweep of the data to insert a new name into the list.
반응형