What is the difference between internal and external sorting?

Data Structures Questions



62 Short 41 Medium 47 Long Answer Questions Question Index

What is the difference between internal and external sorting?

Internal sorting refers to the sorting of data that can be accommodated entirely in the main memory of a computer. It involves rearranging the elements of a data structure, such as an array or a linked list, within the main memory.

On the other hand, external sorting is used when the data to be sorted is too large to fit entirely in the main memory. It involves dividing the data into smaller chunks that can fit in the memory, sorting these chunks, and then merging them together to obtain the final sorted result.

In summary, the main difference between internal and external sorting lies in the size of the data being sorted and whether it can be accommodated entirely in the main memory or not.