- The term Sorting refers to the arranging of data in a particular format or order.
- Sorting algorithm specifies the way to arrange data in a particular order.
Why sorting is necessary ?
- It was very difficult to search a single piece of data from the bulk data base so tha data searching time can be optimized to a very high level, if data is stored in a sorted manner.
- Sorting is also used to represent data in more readable formats.
- Sorting algorithms may require some extra space for comparison and temporary storage of few data elements.
Real life example :-
Dictionary − The dictionary stores words in an alphabetical order so that searching of any word becomes easy.