DCSN04C midterms Flashcards
is used to rearrange a given array or list of elements according to a comparison operator on the elements. The comparison operator is used to decide the new order of elements in the respective data structure.
Sorting Algorithm
refers to rearrangement of a given array or list of elements according to a comparison operator on the elements. The comparison operator is used to decide the new order of elements in the respective data structure.
Sorting
uses constant space for producing the output (modifies the given array only) or copying elements to a temporary storage.
In-place Sorting
is when all the data is placed in the main memory or internal memory.
Internal Sorting
is when all the data that needs to be sorted cannot be placed in memory at a time, the sorting is
External Sorting
When two same items appear in the same order in sorted data as in the original array called
Stable sorting
When two same data appear in the different order in sorted data it is called
Unstable sorting
a measure of how long it takes to run an algorithm, is used to categorize sorting algorithms.
Time Complexity
This is the amount of extra space (apart from input array) needed to sort.
Auxiliary Space
A sorting algorithm is said to be stable if the relative order of equal elements is preserved after sorting.
Stability
is one that does not require additional memory to sort the data.
In-Place Sorting
is one that takes advantage of pre-existing order in the data to improve performance.
Adaptive sorting
Sorting is often a crucial step in search algorithms like binary search and Ternary Search.
Searching Algorithms
Sorting data makes it easier to search, retrieve, and analyze.
Data management
Sorting data in databases improves query performance
Database optimization