What type of sort does the SORT function in MATLAB perform?
28 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 27 Jun. 2009
Kommentiert: Royi Avital
am 11 Sep. 2020
Could you tell me the algorithm and/or the running time of the SORT function?
I need to know which sorting algorithm is used by MATLAB when the SORT function is executed.
Akzeptierte Antwort
MathWorks Support Team
am 27 Jun. 2009
Bearbeitet: MathWorks Support Team
am 6 Apr. 2018
The type of sort that is done is a Quick Sort. It is not an 'adaptive sorting' algorithm, and does not deviate much from the standard Quick Sort algorithm. Quick Sort has been found to be one of the fastest algorithms for sorting; it is an O(n log n) operation. We do not have specific time information, since it depends on both the system and the numerical data used in the sort.
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!