Friday, 1 December 2017

Explain in detail about sorting and different types of sorting techniques.

Sorting is a technique to rearrange the elements of a list in ascending or descending order, which can be numerical, lexicographical, or any user-defined order. Sorting is a process through which the data is arranged in ascending or descending order. Sorting can be classified in two types;

Internal Sorts : This method uses only the primary memory during sorting process. All data items are held in main memory and no secondary memory is required this sorting process. If all the data that is to be sorted can be accommodated at a time in memory is called internal sorting. There is a limitation for internal sorts; they can only process relatively small lists due to memory constraints. There are 3 types of internal sorts.

a. Selection Sort : Selection sort algorithm, Heap Sort algorithm
b. Insertion Sort : Insertion sort algorithm, Shell Sort algorithm
c. Exchange Sort : Bubble Sort Algorithm, Quick sort algorithm

External Sorts : Sorting large amount of data requires external or secondary memory. This process uses external memory such as HDD, to store the data which is not fit into the main memory. So, primary memory holds the currently being sorted data only. All external sorts are based on process of merging. Different parts of data are sorted separately and merged together.
Example:- Merge Sort


Thanks
Mukesh Rajput

No comments:

Post a Comment

Thanks
Mukesh Rajput