Loading, please wait...

SORTING

Sorting refers to the operation of arranging a set of data in some given order. A collection of records is called a list where each record contains one or more fields. The field, which contains unique value for each record is known as the key field. Sorting is the operation that performed of arranging to the key value of each record. The records are sorted either numerically or alphanumerically.

 

The records are arranged in ascending or descending order depending on the numerical value of the key. The methods of sorting can be categorized into two ways.

  • Internal Sorting: If all the data that is to be sorted can be arranged at a time in main memory, then internal sorting methods are used.
  • External Sorting: When the data to be sorted can’t be accommodated in the memory at the same time and some has to be kept in auxiliary memory, then external sorting methods are used.