qsort
Versión 1.2 (1,47 KB) por
Malcolm McLean
C-style qsort routine that takes comparison function.
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.
Citar como
Malcolm McLean (2026). qsort (https://la.mathworks.com/matlabcentral/fileexchange/26612-qsort), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Se creó con
R2009b
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS LinuxCategorías
Más información sobre Shifting and Sorting Matrices en Help Center y MATLAB Answers.
Etiquetas
Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
