Merge Sort - Utility in Online Sorting

Utility in Online Sorting

Merge sort's merge operation is useful in online sorting, where the list to be sorted is received a piece at a time, instead of all at the beginning. In this application, we sort each new piece that is received using any sorting algorithm, and then merge it into our sorted list so far using the merge operation. However, this approach can be expensive in time and space if the received pieces are small compared to the sorted list — a better approach in this case is to insert elements into a binary search tree as they are received.

Read more about this topic:  Merge Sort

Famous quotes containing the word utility:

    Moral sensibilities are nowadays at such cross-purposes that to one man a morality is proved by its utility, while to another its utility refutes it.
    Friedrich Nietzsche (1844–1900)