Jump to content

User:Wesgarner/Comparisonofsortingalgorithms

From Wikipedia, the free encyclopedia
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Comparison of algorithms

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