Jump to content

User:Wesgarner/Comparisonofsortingalgorithms

From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by Wesgarner (talk | contribs) at 20:54, 7 December 2009 (Comparison of algorithms). The present address (URL) is a permanent link to this version.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

Comparison of algorithms

[edit]

Main Sorting Algorithms used in Java

Name Average Worst Memory Stable Method Other notes Tiny code size
Selection sort No Selection Its stability depends on the implementation.
Insertion sort Yes Insertion Average case is also , where d is the number of inversions
Shell sort No Insertion
Binary tree sort Yes Insertion When using a self-balancing binary search tree
Insertion
Merge sort Yes Merging
Quicksort No