image thumbnail

Sorting Methods

version (11.8 KB) by Brian Moore
MATLAB implementations of a dozen common sorting algorithms


Updated 20 Jan 2014

View License

This package contains MATLAB implementations of the following common sorting algorithms

1) Bubble sort
2) Bucket sort
3) Cocktail sort
4) Comb sort
5) Counting sort
6) Heap sort
7) Insertion sort
8) Merge sort
9) Quicksort
10) Radix sort
11) Selection sort
12) Shell sort

The code is written in such a way that it can be easily translated into other languages (e.g., each implementation should be quite efficient in C++). For algorithm details, see the excellent Wikipedia articles on each method, or the canonical algorithms text:

Introduction to Algorithms

Cite As

Brian Moore (2021). Sorting Methods (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!