qsort
Versione 1.2 (1,47 KB) da
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.
Cita come
Malcolm McLean (2024). qsort (https://www.mathworks.com/matlabcentral/fileexchange/26612-qsort), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Creato con
R2009b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS LinuxCategorie
Scopri di più su Shifting and Sorting Matrices in Help Center e MATLAB Answers
Tag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.