Sorting Algorithm Comparisons Table

CriteriaBubbleSelectionInsertionMergeQuickCountingTimsort
TechniqueBrute forceBrute forceBrute forceDivide-and-conquerDivide-and-conquerNon comparisonHybrid
Worst TimeO(n2)O(n2)O(n2)O(nlgn)O(n2)O(k+n)O(nlgn)
Average TimeΘ(n2)Θ(n2)Θ(n2)Θ(nlgn)Θ(nlgn)Θ(k+n)Θ(nlgn)
Best TimeΩ(n)Ω(n2)Ω(n)Ω(nlgn)Ω(nlgn)Ω(k+n)Ω(n)
SpaceO(1)O(1)O(1)O(n)O(n)O(k+n)O(n)
StableYesNoYesYesNoYesYes
In-placeYesYesYesNoYesNo
OnlineNoNoYesNoNoNoNo
AdaptiveYesNoYesNoYesNoYes
Suitable forSorted listAlmost sorted listList with unknown order0<=A[i]<=k

Criteria Explanation

  • Technique: Methodology of the sorting algorithm.
  • Worst Time: Worst time complexity (Big-O) of the algorithm.
  • Average Time: Average time complexity (Big-Theta) of the algorithm.
  • Best Time: Best time complexity (Big-Omega) of the algorithm.
  • Space: Space complexity of the algorithm.
  • Stable: Stable algorithm maintains the relative order of input elements with equal values.
  • In-place: In-place algorithm does not use auxiliary data structure to transform the input elements.
  • Online: Online algorithm does not require the entire input available from the start.
  • Adaptive: Adaptive algorithm takes the advantages of presorted array elements.

Reference

Advertisement

Cite This Work
APA Style
Shovon, A. R. (2020, August 15). Sorting Algorithm Comparisons. Ahmedur Rahman Shovon. Retrieved March 29, 2024, from https://arshovon.com/blog/sorting-algorithm-comparisons/
MLA Style
Shovon, Ahmedur Rahman. “Sorting Algorithm Comparisons.” Ahmedur Rahman Shovon, 15 Aug. 2020. Web. 29 Mar. 2024. https://arshovon.com/blog/sorting-algorithm-comparisons/.
BibTeX entry
@misc{ shovon_2020,
    author = "Shovon, Ahmedur Rahman",
    title = "Sorting Algorithm Comparisons",
    year = "2020",
    url = "https://arshovon.com/blog/sorting-algorithm-comparisons/",
    note = "[Online; accessed 29-March-2024; URL: https://arshovon.com/blog/sorting-algorithm-comparisons/]"
}
Related Contents in this Website
Previous Post

Insertion Sort