0% found this document useful (0 votes)
5 views1 page

Sorting Algorithms Summary

The document provides a comparison of various sorting algorithms, detailing their types, main characteristics, and time complexities for best, average, and worst cases, as well as space complexity. Algorithms include Selection Sort, Bubble Sort, Insertion Sort, Merge Sort, Quick Sort, Heap Sort, Counting Sort, Radix Sort, and Bucket Sort. Each algorithm is categorized as either Comparison-Based or Non-Comparative, with specific performance metrics outlined for each type.

Uploaded by

code dv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Sorting Algorithms Summary

The document provides a comparison of various sorting algorithms, detailing their types, main characteristics, and time complexities for best, average, and worst cases, as well as space complexity. Algorithms include Selection Sort, Bubble Sort, Insertion Sort, Merge Sort, Quick Sort, Heap Sort, Counting Sort, Radix Sort, and Bucket Sort. Each algorithm is categorized as either Comparison-Based or Non-Comparative, with specific performance metrics outlined for each type.

Uploaded by

code dv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Sorting AlgorithmType of Algorithm Main Characteristics Best Time Complexity

Average Time Complexity


Worst Time Complexity
Space Comp

Selection Sort Comparison-Based Selects min element and swaps O(n^2) O(n^2) O(n^2) O(1)

Bubble Sort Comparison-Based Swaps adjacent elements O(n) O(n^2) O(n^2) O(1)

Insertion Sort Comparison-Based Builds sorted array one by one O(n) O(n^2) O(n^2) O(1)

Merge Sort Divide and Conquer Recursively divides array O(n log n) O(n log n) O(n log n) O(n)

Quick Sort Divide and Conquer Partitions array around a pivot O(n log n) O(n log n) O(n^2) O(log n)

Heap Sort Comparison-Based Uses binary heap data structure O(n log n) O(n log n) O(n log n) O(1)

Counting Sort Non-Comparative Counts occurrences of elements O(n + k) O(n + k) O(n + k) O(n + k)

Radix Sort Non-Comparative Sorts based on digit places O(nk) O(nk) O(nk) O(n + k)

Bucket Sort Non-Comparative Distributes elements into buckets O(n + k) O(n + k) O(n^2) O(n + k)

Legend:

- n: Number of elements in the array

- k: Range of input (for Counting, Radix, and Bucket Sort)

You might also like