{"count":12,"data":[{"name":"Bubble Sort","timeComplexityBest":"O(n)","timeComplexityAverage":"O(n)","timeComplexityWorst":"O(n)","spaceComplexity":"O(1)","stable":true,"description":"Repeatedly steps through the list, compares adjacent elements and swaps them if they are in the wrong order. The pass through the list is repeated until the list is sorted.","useCase":"Educational purposes and very small datasets. Not suitable for production use on large datasets.","inPlace":true,"category":"Comparison-based"},{"name":"Insertion Sort","timeComplexityBest":"O(n)","timeComplexityAverage":"O(n)","timeComplexityWorst":"O(n)","spaceComplexity":"O(1)","stable":true,"description":"Builds the final sorted array one item at a time by inserting each element into its proper position among the previously sorted elements.","useCase":"Small datasets, nearly sorted data, or as part of hybrid algorithms like Timsort. Efficient for data that arrives in real-time.","inPlace":true,"category":"Comparison-based"},{"name":"Selection Sort","timeComplexityBest":"O(n)","timeComplexityAverage":"O(n)","timeComplexityWorst":"O(n)","spaceComplexity":"O(1)","stable":false,"description":"Divides the input into a sorted and unsorted region. Repeatedly selects the smallest (or largest) element from the unsorted region and moves it to the end of the sorted region.","useCase":"Scenarios where memory write operations are expensive, as it minimizes the number of swaps. Not efficient for large datasets.","inPlace":true,"category":"Comparison-based"},{"name":"Merge Sort","timeComplexityBest":"O(n log n)","timeComplexityAverage":"O(n log n)","timeComplexityWorst":"O(n log n)","spaceComplexity":"O(n)","stable":true,"description":"Divide-and-conquer algorithm that divides the array into two halves, recursively sorts them, and then merges the two sorted halves back together.","useCase":"Large datasets requiring guaranteed O(n log n) performance. Preferred when stability is required. Used in external sorting for large files.","inPlace":false,"category":"Comparison-based"},{"name":"Quick Sort","timeComplexityBest":"O(n log n)","timeComplexityAverage":"O(n log n)","timeComplexityWorst":"O(n)","spaceComplexity":"O(log n)","stable":false,"description":"Divide-and-conquer algorithm that selects a pivot element and partitions the array around it, then recursively sorts the partitions.","useCase":"General-purpose sorting for large datasets. Often faster than Merge Sort in practice due to better cache locality. Default choice in many standard libraries.","inPlace":true,"category":"Comparison-based"},{"name":"Heap Sort","timeComplexityBest":"O(n log n)","timeComplexityAverage":"O(n log n)","timeComplexityWorst":"O(n log n)","spaceComplexity":"O(1)","stable":false,"description":"Builds a binary heap data structure from the array and repeatedly extracts the maximum element to build the sorted array.","useCase":"Situations requiring guaranteed O(n log n) time with O(1) space. Used in priority queue implementations and when memory is constrained.","inPlace":true,"category":"Comparison-based"},{"name":"Radix Sort","timeComplexityBest":"O(dn)","timeComplexityAverage":"O(dn)","timeComplexityWorst":"O(dn)","spaceComplexity":"O(n + k)","stable":true,"description":"Non-comparison sort that processes integer keys digit by digit, from least significant to most significant or vice versa, using counting sort as a subroutine.","useCase":"Sorting integers or fixed-length strings where the range of keys is not significantly larger than the number of items. Fast for specific data types.","inPlace":false,"category":"Non-comparison"},{"name":"Counting Sort","timeComplexityBest":"O(n + k)","timeComplexityAverage":"O(n + k)","timeComplexityWorst":"O(n + k)","spaceComplexity":"O(k)","stable":true,"description":"Non-comparison sort that counts the number of occurrences of each distinct key value and uses arithmetic to determine positions in the output sequence.","useCase":"Sorting integers when the range k is not significantly larger than n. Often used as a subroutine in Radix Sort.","inPlace":false,"category":"Non-comparison"},{"name":"Bucket Sort","timeComplexityBest":"O(n + k)","timeComplexityAverage":"O(n + k)","timeComplexityWorst":"O(n)","spaceComplexity":"O(n + k)","stable":true,"description":"Distributes elements into a number of buckets, sorts each bucket individually using another algorithm, then concatenates the sorted buckets.","useCase":"Uniformly distributed data over a range. Effective for floating-point numbers distributed across a known interval.","inPlace":false,"category":"Non-comparison"},{"name":"Shell Sort","timeComplexityBest":"O(n log n)","timeComplexityAverage":"O(n^(3/2))","timeComplexityWorst":"O(n)","spaceComplexity":"O(1)","stable":false,"description":"Generalization of insertion sort that allows the exchange of items that are far apart. The algorithm starts with large gaps and progressively reduces them.","useCase":"Medium-sized datasets where a simple implementation is desired with better performance than basic quadratic algorithms.","inPlace":true,"category":"Comparison-based"},{"name":"Tim Sort","timeComplexityBest":"O(n)","timeComplexityAverage":"O(n log n)","timeComplexityWorst":"O(n log n)","spaceComplexity":"O(n)","stable":true,"description":"Hybrid stable sorting algorithm derived from Merge Sort and Insertion Sort. Identifies naturally occurring runs in the data and merges them intelligently.","useCase":"Real-world data that often contains ordered subsequences. Default sorting algorithm in Python and Java. Excellent for partially sorted data.","inPlace":false,"category":"Hybrid"},{"name":"Cocktail Shaker Sort","timeComplexityBest":"O(n)","timeComplexityAverage":"O(n)","timeComplexityWorst":"O(n)","spaceComplexity":"O(1)","stable":true,"description":"Variation of Bubble Sort that traverses the list in both directions alternately. Also known as Bidirectional Bubble Sort or Shaker Sort.","useCase":"Slightly better than Bubble Sort for lists with elements that are mostly sorted. Still primarily educational.","inPlace":true,"category":"Comparison-based"}]}