You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
raghusumanth edited this page Jan 8, 2022
·
12 revisions
Sorting Algorithms:
Sorting Terminology:
**What is in-place sorting?**
An in-place sorting algorithm uses constant space for producing the output (modifies the given array only). It sorts the list only by modifying the order of the elements within the list.
For example, Insertion Sort and Selection Sorts are in-place sorting algorithms
Merge Sort is not in-place, also the implementation for counting sort is not in-place sorting algorithm.
What are Internal and External Sortings?
When all data that needs to be sorted cannot be placed in-memory at a time, the sorting is called external sorting. External Sorting is used for massive amount of data. Merge Sort and its variations are typically used for external sorting
When all data is placed in-memory, then sorting is called internal sorting.
**Stability in sorting algorithms:**