What is Sorting? Sorting is refers to the operation or technique of arranging and rearranging sets of data in some specific order. A collection of records called a list where every record is having one or more fields. The fields which contains unique value for each record, is termed as the key field. For example, a phone number directory can be thought of as a list where each record has three fields – ‘name’ of the person, ‘address’ of those person, and their ‘phone numbers’. Being unique phone number can work as a key to locate any record in the list. Sorting is the operation performed to arrange the records of a table or list in some order according to some specific ordering criterion. Sorting is performed according to some key value of each record. The records are either sorted either numerically or alphanumerically. The records are then arranged in ascending or descending order depending on the numerical value of the key. Here is an example, where the sorting of a lists...
Comments
Post a Comment