User:Wesgarner/Comparisonofsortingalgorithms
Appearance
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 |