qsort

版本 1.2 (1.5 KB) 作者: Malcolm McLean
C-style qsort routine that takes comparison function.
826.0 次下载
更新时间 2014/11/29

查看许可证

Simple implementation of quicksort algorithm in Matlab. It's O(N log N) but the only optimisation is that the pivot point is the central element (to prevent pathological behaviour on sorted input). It takes a C-style comparison function. If the vector to sort is a cell array, the comparison function works on cell contents. Any type of data can be sorted, as long as you can write a comparator for it.

引用格式

Malcolm McLean (2024). qsort (https://www.mathworks.com/matlabcentral/fileexchange/26612-qsort), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2009b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Shifting and Sorting Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.2

Toolbox

1.1.0.0

Patch to reduce the number of recursions when fed data of all equal value.

1.0.0.0