Explore tens of thousands of sets crafted by our community.
Common Sorting Algorithms
10
Flashcards
0/10
Radix Sort
Complexity: for keys which have digits Best Use Case: Large datasets where keys are integers or can be represented as integer sequences (like strings).
Selection Sort
Complexity: Always Best Use Case: Small datasets where simplicity is important and memory usage is a concern.
Counting Sort
Complexity: where is the range of the non-negative key values Best Use Case: Small integer range datasets and when counting the occurrences of each unique element is possible.
Bucket Sort
Complexity: Average-case , Worst-case Best Use Case: Datasets that are uniformly distributed across the range and when there is a way to evenly distribute data into buckets.
Bubble Sort
Complexity: Average and worst-case , Best-case Best Use Case: Small datasets or when the data is nearly sorted.
Merge Sort
Complexity: Always Best Use Case: Large datasets where stable sort and predictable time are important, with enough space to handle the copies of the array.
Quick Sort
Complexity: Average-case , Worst-case Best Use Case: Large datasets with high-performance requirements, especially when in-place sorting is needed.
Heap Sort
Complexity: Always Best Use Case: Sorting large datasets where an in-place sort and memory usage are important factors.
Insertion Sort
Complexity: Average and worst-case , Best-case Best Use Case: Small datasets, nearly sorted data, or when simplicity is valued.
TimSort
Complexity: Average-case , Worst-case Best Use Case: Datasets which have partially ordered patterns, commonly used as the default sorting algorithm in some programming languages.
© Hypatia.Tech. 2024 All rights reserved.