Sorting Techniques
The process of getting data elements into order is
called sorting.
There are many sorting algorithms available. But no
one algorithm for sorting is best in all cases. Ideally, one uses different algorithms
depending on whether one is sorting a small set or a large set, on whether the
individual elements of the set occupy a lot of storage (so that moving them
around in memory is time consuming), on how easy it is to the other, and so on.
That means different application requires different sorting methods.
The sorting
methods are broadly categorized into two
Internal Sorting:
In internal sorting, all the data elements to be sorted are present in
the main memory.
External Sorting: These techniques are applied to
large data sets which reside on secondary devices and cannot be complexity fit
in the main memory.
Sorting algorithms can be computational expensive, particularly on data sets become large. They can be classified into:
- Simple algorithms
- Sophisticated Algorithms
To Sort’ N’ data elements simple techniques require
the order of N2 O (N2) comparisons. Depending on the
number of swapping and moving a portion of data, sorting algorithm requires
considerable amount of processing time. Thus, minimize swapping or moving of
data.
Simple Algorithms: Bubble sort, Insertion Sort,
Selection Sort.
Sophisticated Algorithms: Quick Sort, Merge Sort,
Heap Sort etc
0 comments:
Post a Comment