quicksort
Sort a row vector in ascending order using a variant of Quicksort. Original work: C. A. R. Hoare: Quicksort. In: The Computer Journal. 5(1), 1962, p. 10–15. This implementation works in place and runs in O(n)=n*log(n). There are no practical advantages over the build-in sort function. The purpose of this implementation is to show that quicksort can be implemented in Matlab with O(n)=n*log(n) runtime (average case).
Cite As
Christian Werner (2026). quicksort (https://www.mathworks.com/matlabcentral/fileexchange/66704-quicksort), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.2.0.2 | Removed input argument check within recursion (Shlomo Geva, thank you for commenting!) |
||
| 1.2.0.1 | Removed input argument check within recursion (Shlomo Geva, thank you for commenting!) |
||
| 1.2.0.0 | Improved documentation. |
||
| 1.1.0.0 | Improved error checking, improved documentation. |
||
| 1.0.0.0 |
