Sorting, as the name suggest, is use to arrange a series of data type (in computer science language) in either ascending or descending order given the choice.
Data Type can be anything of integer, character, string or can be an object type itself.
Example:
Input : 3, 5, 1, 7, 9, 2
Output : 1, 2, 3, 5, 7, 9 (Ascending)
Input : 3, 5, 1, 7, 9, 2
Output : 9, 7, 5, 3, 2, 1 (Ascending)
In either case we have performed a sorting operation on a set of given numbers.
Sorting Techniques
Based on situations (Time Complexity, Space Complexity, ease to use) we can use different techniques for sorting a given set. All techniques have their own pros and cons.
Some very common type sorting algorithms used in Computer Science are :
Hope you like it. Please comments for doubts.
Happy Learning !!!
Data Type can be anything of integer, character, string or can be an object type itself.
Example:
Input : 3, 5, 1, 7, 9, 2
Output : 1, 2, 3, 5, 7, 9 (Ascending)
Input : 3, 5, 1, 7, 9, 2
Output : 9, 7, 5, 3, 2, 1 (Ascending)
In either case we have performed a sorting operation on a set of given numbers.
Sorting Techniques
Based on situations (Time Complexity, Space Complexity, ease to use) we can use different techniques for sorting a given set. All techniques have their own pros and cons.
Some very common type sorting algorithms used in Computer Science are :
- Bubble Sort
- Insertion Sort
- Selection Sort
- Merge Sort
- Quick Sort
- Heap Sort (for Tree Data Structures)
Hope you like it. Please comments for doubts.
Happy Learning !!!
0 comments :
Post a Comment