• Sorting in Data Structure

    Sorting in Data Structure

    Introduction:

    Sorting in Data Structure, 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 ways:

    Internal Sorting:

    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 a time in memory is called internal sorting. There is a limitation for internal sorting, they can only process relatively small lists due to memory constraints. There are 3 types of internal sorts.

    1. Selection Sort:

      1. Selection sort algorithm
      2. Heap sort algorithm
    2. Insertion Sort:

      1. Insertion sort algorithm
      2. Shell sort algorithm
    3. Exchange Sort:

      1. Bubble sort algorithm
      2. Quick sort algorithm

    External Sorting:

    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 fir 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.

    • Merge Sort

    Appreciate my work :Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedInPin on PinterestShare on RedditShare on StumbleUponShare on TumblrDigg thisShare on YummlyShare on VKFlattr the authorBuffer this page

Leave a Reply

Your email address will not be published. Required fields are marked *